Print only some labels along the x-axis in pChart 2.0

930 Views Asked by At

I have a set of data that I show in my chart generated in pChart, like this:

sample graph in pchart

The problem is that I want to print only some labels in the x-axis and show the last label in the last point, keeping the same appearance of the curve.

How can I do that?

There is a function that does this in pChart 1:

void setFixedScale($VMin,$VMax,$Divisions=5,$VXMin=0,$VXMin=0,$XDivisions=5) 

Is there a similar function like it in pChart2 or anyway to achieve a similar display?

1

There are 1 best solutions below

0
On

Set the points you do not want to show up on the axis as NULL.

From your above x-axis labels, you would do something like this if you wanted to show only the first and last labels, but still keep the graph plotted for the other unmarked points:

$MyData->addPoints(array("01-Nov", NULL, NULL, NULL, NULL, "25-Jan"),"Labels");