jpgraph画柱状图部分代码如下:
$bplot1array = array();
while($row = mysql_fetch_array($query)){
$datay = array();
for($i = 0; $i < 7; $i++){
$datay[] = $row[$i];
}
$bplot = new BarPlot($datay);
$bplot->SetFillColor('[email protected]');
$bplot->SetLegend('Label 1');
$bplot->SetShadow('[email protected]');
$bplotarray[] = $bplot;
}
$gbarplot = new GroupBarPlot($bplotarray);
$gbarplot->SetWidth(0.6);
$graph->Add($gbarplot);
$graph->Stroke();
报错$bplotarray为空。$datay测试了,有值。
$bplot1array = array();
while($row = mysql_fetch_array($query)){
$datay = array();
for($i = 0; $i < 7; $i++){
$datay[] = $row[$i];
}
$bplot = new BarPlot($datay);
$bplot->SetFillColor('[email protected]');
$bplot->SetLegend('Label 1');
$bplot->SetShadow('[email protected]');
$bplotarray[] = $bplot;
}
$gbarplot = new GroupBarPlot($bplotarray);
$gbarplot->SetWidth(0.6);
$graph->Add($gbarplot);
$graph->Stroke();
报错$bplotarray为空。$datay测试了,有值。
while($row = mysql_fetch_array($query)){
$datay = array();
for($i = 0; $i < 7; $i++){
$datay[] = $row[$i];
}
$bplot = new BarPlot($datay);
$bplot->SetFillColor('[email protected]');
$bplot->SetLegend('Label 1');
$bplot->SetShadow('[email protected]');
$bplotarray[] = $bplot;
}
$gbarplot = new GroupBarPlot($bplotarray);
$gbarplot->SetWidth(0.6);
$graph->Add($gbarplot);
$graph->Stroke();
已经把
$bplot1array = array();
改成
$bplotarray = array();