+ -
当前位置:首页 → 问答吧 → jpgraph画柱状图,数组为空

jpgraph画柱状图,数组为空

时间:2010-08-19

来源:互联网

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测试了,有值。

作者: yufan_22   发布时间: 2010-08-19

代码第一行贴错了
应为
$bplotarray = array();

作者: yufan_22   发布时间: 2010-08-19