<?php //JPGRAPH 生成3D饼图 require_once("jpgraph/jpgraph.php"); require_once("jpgraph/jpgraph_pie.php"); require_once("jpgraph/jpgraph_pie3d.php"); $arrData = array(19, 23, 34, 136, 50, 65, 70, 178); $arrMatch = array("一", "二", "三", "四", "五", "六", "七", "八"); $graph = new PieGraph(400, 300); $graph->SetShadow(); $graph->title->Set("第一个3D饼图"); $graph->title->SetFont(FF_SIMSUN, FS_BOLD); $pieplot = new PiePlot3D($arrData); $pieplot->SetLegends($arrMatch);//设置图例 $pieplot->SetCenter(0.4);//设置饼图的中心位置 $graph->Add($pieplot); $graph->legend->SetFont(FF_SIMSUN, FS_BOLD); $graph->Stroke('3d.jpg'); ?>