pChart 2.x forum
http://wiki.pchart.net/forum/

AxisBoundary issues
http://wiki.pchart.net/forum/viewtopic.php?f=3&t=2180
Page 1 of 1

Author:  CastleSeven [ Wed Sep 21, 2011 1:54 pm ]
Post subject:  AxisBoundary issues

Hey everyone, I'm trying to form a line chart that scales automatically, but if I use the FLOATING scale mode, my line chart shoots off the top of the graph. So I opted to test with the MANUAL scale mode and set the axis boundaries statically. This works, but my input data will be changing, so I'd like to be able to grab the max of the data points myself and feed it into the AxisBoundary array. My problem is, the following doesn't work:


$maxVoltage = max($xAxis);
$axisBoundaries = array(0=>array("Min"=>0,"Max"=>$maxVoltage));
$scaleSettings = array("Mode"=>SCALE_MODE_MANUAL,"ManualScale"=>$axisBoundaries,"DrawSubTicks"=>TRUE,"DrawArrows"=>TRUE,"ArrowSize"=>6);
$myPicture->drawScale($scaleSettings);

The issue lies where I'm setting the "Max" value. If I hardcode a value, it works fine, but using a variable doesn't work. Is this functionality supported?

Thanks!

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/