<?php
require_once "/data/webroot/resource/php/src/jpgraph.php";
require_once "/data/webroot/resource/php/src/jpgraph_pie.php";
require_once "/data/webroot/resource/php/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);
//創(chuàng)建畫布
$graph=new pieGraph(500,500);
//設置圖像邊界范圍
$graph->img->SetMargin(30,30,80,30);
//設置標題
$graph->title->Set("piePlot3d Test");
//得到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->Stroke();