PHP生成折线图---Jparaph-Mine
vendor('Jpgraph.jpgraph');vendor ('Jpgraph.jpgraph_line');
//数据
$ydata = explode(",",$value);
//画布的大小
$width=450;
$height=250;
// 创建一个画布,必要的两行
$graph = new \Graph($width,$height);
$graph->SetScale('intlin');
//传递数据创建折线
$lineplot=new \LinePlot($ydata);
// 将折线增加到画布上
$graph->Add($lineplot);
// 显示画布
$graph->Stroke("路径/XXX.png"); //这个是生成折线图保存路径
页:
[1]