Using pChart to draw plot graphs:
$Data = new pData();
$Data->AddPoints(array(1,2,10), 'x');
$Data->AddPoints(array(6,8,3), 'y');
$Data->setAbscissa('x');
$Chart = new pImage($w, $h, $Data);
$Chart->setGraphArea(100, 0, $w-1, $h-50);
$Chart->drawScale(array('Mode' => SCALE_MODE_FLOATING));
$Chart->drawPlotChart();
$Chart->Stroke();
On the plot, the distance along the X axis from 1 to 2 is the same as the distance from 2 to 10. How do I make pChart interpret abscissa values as the numbers they are?
I had a look into pChart code, and I'm almost sure that this is their only way to render data: X-axis ticks are spread evenly, number of ticks equals to number of data points in series.
But you still can get what you want by defining some points as missing. In case of your specific example "fixed" code would look like this (the rest is unchanged):
VOIDis a constant defined somewhere withinpData.class.php, so, you already have it available.And here is how end result looks like: https://i.stack.imgur.com/j8Owr.jpg (
$w = 500; $h = 400;)