Defined X and Y Axis in pChart 2.0

2.3k Views Asked by At

I'm using the line graph of pChart for a partograph.

Now, my problem is, I can't define the values for the x and y axis. The y-axis will adjust automatically depending on the data that is set on the graph. This is not what I want.

Please see illustration:

By default, when no data is to be plotted in the graph.

When loaded with data.

Notice that the values of the Y-axis changed. What I want is to make the scale of axis from 0 to 10 (1,2,3,4,5,6,7,8,9,10).

1

There are 1 best solutions below

0
On

You will need to set the scale manualy. For example:

 $AxisBoundaries = array(0=>array("Min"=>0,"Max"=>100));
 $ScaleSettings  = array    
 ("Mode"=>SCALE_MODE_MANUAL,"ManualScale"=>$AxisBoundaries,"DrawSubTicks"=>TRUE,"DrawArrows"=>TRUE,"ArrowSize"=>6);
 $myPicture->drawScale($ScaleSettings);

Hope this helps