一 代码
<?php
require_once 'src/jpgraph.php'; //导入Jpgraph类库
require_once 'src/jpgraph_pie.php'; //导入Jpgraph类库的饼图功能
require_once 'src/jpgraph_pie3d.php'; //导入Jpgraph类库的3D饼图功能
$data = array(89, 78, 99, 65, 92); //设置统计数据
$graph = new PieGraph(600, 300);
$graph->SetShadow();
$graph->title->Set("部门业绩评比表");
$graph->title->SetFont(FF_SIMSUN, FS_BOLD);
$pieplot = new PiePlot3D($data);
$pieplot->SetCenter(0.4);
$month = array('ASP部门', 'PHP部门', 'JSP部门', '.net部门', 'C++部门');
$pieplot->SetLegends($month);
$graph->legend->SetFont(FF_SIMSUN, FS_BOLD);
$graph->Add($pieplot);
$graph->Stroke();
二 运行结果