include(ROOT.'library/jpgraph-3.5.0b1/src/jpgraph.php');
include(ROOT.'library/jpgraph-3.5.0b1/src/jpgraph_bar.php');
$graph = new Graph();
$graph->SetScale('textlin',5,100);
$graph->SetShadow();
$graph->img->SetMargin(40,30,20,40);
$graph->SetColor('wheat');
//数据
$data = array(80,73,89,85,92,75,85,65,84,79,85,98);
$barplot = new BarPlot($data);
$barplot->value->Show();
$graph->Add($barplot);
$barplot->SetColor('red');
$barplot->SetFillColor('yellow');
$graph->title->SetFont(FF_SIMSUN,FS_BOLD,12);
$title = iconv("UTF-8","gb2312",'年度家庭收入');
$graph->title->Set($title);
$xtitle = iconv("UTF-8","gb2312",'月份');
$graph->xaxis->title->SetFont(FF_SIMSUN,FS_BOLD);
$graph->xaxis->title->Set($xtitle);
$graph->yaxis->title->SetFont(FF_SIMSUN,FS_BOLD);
$ytitle = iconv("UTF-8","gb2312",'元');
$graph->yaxis->title->Set($ytitle);
$graph->Stroke();
jpgraph BarPlot 柱形图
最新推荐文章于 2021-03-27 15:54:40 发布