php使用Jpgraph繪制3D餅狀圖的方法
更新時間:2015年06月10日 16:37:27 作者:zhuzhao
這篇文章主要介紹了php使用Jpgraph繪制3D餅狀圖的方法,涉及jpgraph使用PiePlot3D創(chuàng)建3D餅狀圖的技巧,需要的朋友可以參考下
本文實例講述了php使用Jpgraph繪制3D餅狀圖的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:
<?php
include ("src/jpgraph.php");
include ("src/jpgraph_pie.php");
include ("src/jpgraph_pie3d.php");
$data = array(19,23,34,38,45,67,71,78,85,87,90,96);
$graph = new PieGraph(400,300);
$graph->SetShadow();
$graph->title->Set("年度收支表");
$graph->title->SetFont(FF_SIMSUN,FS_BOLD);
$pieplot = new PiePlot3D($data); //創(chuàng)建PiePlot3D對象
$pieplot->SetCenter(0.4); //設置餅圖中心的位置
$pieplot->SetLegends($gDateLocale->GetShortMonth()); //設置圖例
$graph->Add($pieplot);
$graph->Stroke();
?>
運行效果圖如下:

希望本文所述對大家的php程序設計有所幫助。
相關文章
PHP實現(xiàn)將textarea的值根據(jù)回車換行拆分至數(shù)組
這篇文章主要介紹了PHP實現(xiàn)將textarea的值根據(jù)回車換行拆分至數(shù)組,涉及表單元素及explode拆分字符串的相關技巧,需要的朋友可以參考下2015-06-06

