jpGraph学习——绘制3D饼形图
<?php //XY坐标图 require_once("../src/jpgraph.php"); require_once("../src/jpgraph_pie.php"); require_once("../src/jpgraph_pie3d.php"); $data = array(0 => 3.5, 1 => 4.6, 2 => 9.1, 3 => 21.9, 4 => 42.3, 5 => 90.7, 6 => 183.5, 7 => 127.5, 8 => 61.4, 9 => 33.5, 10 => 11.5, 11 => 4.4); //创建画布 $graph = new pieGraph(600,500); //设置图像边界范围 $graph->img->SetMargin(30,30,80,30); //设置标题 $graph->title->SetFont(FF_CHINESE); //--设置支持中文标题 $graph->title->Set("3D饼形图"); //得到3D饼图对象 $piePlot3d = new piePlot3d($data); //设置图例 $piePlot3d->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")); //设置图例位置 $graph->legend->Pos(0.1,0.15,"left","center"); //将绘制好的3D饼图加入到画布中 $graph->Add($piePlot3d); //输出 $graph->Stroke();
输出:
本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!