JpGraph棒グラフ

Last-modified: 2014-11-21 (金) 09:29:20

for($d=1; $d<=$end_day; $d++)
{

 if(!empty($summary[$d]))
 {
       $summary1[$d] = $summary[$d];
 } else {
       $summary1[$d] = 0;
 }

}
$graph = new Graph(820, 200, "auto");
$graph->SetScale("textlin");
$graph->img->SetMargin(40, 30, 20, 40); // Left,Right,Top,Bottom
$graph->setFrame(true, "#e0e0e0", 1);
$graph->SetMarginColor("#949292"); // 外枠背景色
$graph->SetColor("#c2c0c0"); // 背景色
$graph->yaxis->SetColor("#e0e0e0");
$graph->xaxis->SetColor("#e0e0e0");
$b1 = new BarPlot($summary1);
$b1->setColor("#9fd1c9");
$b1->SetFillColor("#c7e8e4");
$graph->Add($b1);
$graph->Stroke(DOC_DIR."/operation/jpgraph/jpgraph.png");

※HTML側

img src="./jpgraph/jpgraph.png">