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?
A scatter plot is what I'm looking for. This draws the right X-Y plot:
$Data = new pData();
$Data->AddPoints(array(1,2,10), 'x');
$Data->AddPoints(array(6,8,3), 'y');
$Data->setAxisXY(0,AXIS_X);
$Data->setAxisPosition(0, AXIS_POSITION_BOTTOM);
$Data->setAxisXY(1,AXIS_Y);
$Data->setSerieOnAxis('y', 1);
$Data->SetScatterSerie('x', 'y');
$Chart = new pImage($w, $h, $Data);
$Chart->setGraphArea(100,0,$w-1,$h-50);
$Scatter = new pScatter($Chart, $Data);
$Scatter->drawScatterScale();
$Scatter->drawScatterPlotChart(array());
$Chart->Stroke();