Jpgraph:如何手动设置X轴和Y轴的范围


Jpgraph: How to manually set Ranges for X-axis and Y-asxis

大家好,我需要对Jp图做一些更改。。。

1) 我需要设置X轴范围从"0"到"100",步长为"10"。

2) 我需要将Y轴范围设置为从"-5"到"6",步长为"1"。

3) 我需要在图上标记所选的点,比如如果所选的值是

"70"answers"2"(如图所示),我想将其命名为"point1",如果第二个选择的点位于"80"answers"3"上,那么我想将它命名为"point 2"点1和点2应该出现在图本身上。。有办法解决这个问题吗?请帮我解决这些问题。。。

$graph = new Graph(450,400,'auto');
$graph->SetScale("textlin");
// set major and minor tick positions manually
$graph->yaxis->SetTickPositions(array(0,10,20,30,40,50,60,70,80,90,100), array(5,15,25,35,45,55,65,75,85,95);
$graph->xaxis->SetTickLabels(array(-5,-4,-3,-2,-1,0,1,2,3,4,5,6));
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
$graph->xaxis->HideLine(false);
$graph->xaxis->HideTicks(false,false);

这就是第1点和第2点。我不知道3,但它们在网上有很多教程。退房http://jpgraph.net/