本文實例講述了php使用Jpgraph繪制餅狀圖的方法。分享給大家供大家參考。具體實現方法如下:
<?php
include ("src/jpgraph.php");
include ("src/jpgraph_pie.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 PiePlot($data);
$graph->Add($pieplot);
$graph->Stroke();
?>
運行效果如下:

希望本文所述對大家的php程序設計有所幫助。