<?php // content="text/plain; charset=utf-8"
require_once ('src/jpgraph.php');
require_once ('src/jpgraph_line.php');
require_once ('src/jpgraph_bar.php'); //bar1
$data1y=array(115,130,135,130,110,130,130,150,130,130,150,120);//line1
$data6y=array(50,58,60,58,53,58,57,60,58,58,57,50);// Create the graph. These two calls are always required
$graph = new Graph(750,320,'auto');
$graph->SetScale("textlin");//设定Y轴的取值区间为0到最大值
//$graph->yaxis->scale->SetGrace(20);//设置y轴刻度值分辨率
//$graph->yscale->ticks->Set(50,4);    //设置刻度值为$maxV的一半,分两步显示(大概是这个意思吧)
//$graph->SetYScale("int",0,200);    //设置刻度值为$maxV的一半,分两步显示(大概是这个意思吧)
//$graph->yaxis->HideTicks(true,false);         //大刻度显示true,小刻度显示false。本例中就是只显示110和220
//$graph->SetYScale("int",0,10);
$graph->yaxis->SetTickLabels(range(1,200)); 
$graph->SetY2Scale("int",0,150);
$graph->SetY2OrderBack(false);//$graph->SetMargin(35,50,20,5);$theme_class = new UniversalTheme;
$graph->SetTheme($theme_class);$graph->yaxis->SetTickPositions(array(0,50,100,150,200,250,300,350), array(25,75,125,175,275,325));
//$graph->y2axis->SetTickPositions(array(30,40,50,60,70,80,90));$months = $gDateLocale->GetShortMonth();
$months = array_merge(array_slice($months,3,9), array_slice($months,0,3));
$months = array(iconv("UTF-8","GB2312//IGNORE",'一月'),'一月','一月','一月','一月','一月','一月','一月');$graph->SetBox(false);$graph->ygrid->SetFill(false);
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
// Setup month as labels on the X-axis
$graph->xaxis->SetTickLabels($months);//$y_arr = array(10,15,20,30);
//$graph->yaxis->SetTickLabels($y_arr);// Create the bar plots
$b1plot = new BarPlot($data1y);$lplot = new LinePlot($data6y);$gbplot = new GroupBarPlot(array($b1plot));// ...and add it to the graPH
$graph->Add($gbplot);
$graph->AddY2($lplot);$count = 9;
$max = 5;for($i=0;$i<$count;$i++){
if($i == $max){
$color_arr[] = '#aaa0CD';
}else{
$color_arr[] = '#0000CD';
}
}$b1plot->SetColor("#0000CD");
$b1plot->SetFillColor($color_arr);
$b1plot->SetLegend(iconv("UTF-8","GB2312//IGNORE",'我的得分'));$lplot->SetBarCenter();
$lplot->SetColor("yellow");
$lplot->SetLegend(iconv("UTF-8","GB2312//IGNORE",'全国平均得分'));
$lplot->->SetType(MARK_DIAMOND,'',1.0);
$lplot->->SetWeight(2);
$lplot->->SetWidth(8);
$lplot->->setColor("yellow");
$lplot->->setFillColor("yellow");
$graph->legend->SetFrameWeight(1);
$graph->legend->SetColumns(6);
$graph->legend->SetColor('#4E4E4E','#00A78A');
$graph->title->SetFont(FF_SIMSUN,FS_BOLD);
$graph->title->Set(iconv("UTF-8","GB2312//IGNORE",'统计结果'));
$datay1 = array(90,90,90,90,90,90,90,90,90,90,90,90);
$datay2 = array(30,30,30,30,30,30,30,30,30,30,30,30);
$p1 = new LinePlot($datay1);
$graph->Add($p1);
$p1->SetBarCenter();
$p1->SetColor("#6495ED");
$p1->SetLegend(iconv("UTF-8","GB2312//IGNORE",'判定'));// Create the second line
$p2 = new LinePlot($datay2);
$graph->Add($p2);
$p2->SetBarCenter();
$p2->SetColor("#B22222");
$p2->SetLegend(iconv("UTF-8","GB2312//IGNORE",'倾向'));
// Display the graph
$graph->Stroke();
?>
y轴刻度线值为0,5,10,15,和统计信息的数据不符啊,怎么更改y轴刻度线的值?