Line | |
---|
1 | <?php // content="text/plain; charset=utf-8" |
---|
2 | require_once ('jpgraph/jpgraph.php'); |
---|
3 | require_once ('jpgraph/jpgraph_pie.php'); |
---|
4 | require_once ('jpgraph/jpgraph_pie3d.php'); |
---|
5 | |
---|
6 | // Some data |
---|
7 | $data = array(20,27,45,75,90); |
---|
8 | |
---|
9 | // Create the Pie Graph. |
---|
10 | $graph = new PieGraph(350,200); |
---|
11 | $graph->SetShadow(); |
---|
12 | |
---|
13 | // Set A title for the plot |
---|
14 | $graph->title->Set("Example 1 3D Pie plot"); |
---|
15 | $graph->title->SetFont(FF_VERDANA,FS_BOLD,18); |
---|
16 | $graph->title->SetColor("darkblue"); |
---|
17 | $graph->legend->Pos(0.1,0.2); |
---|
18 | |
---|
19 | // Create pie plot |
---|
20 | $p1 = new PiePlot3d($data); |
---|
21 | $p1->SetTheme("sand"); |
---|
22 | $p1->SetCenter(0.4); |
---|
23 | $p1->SetAngle(30); |
---|
24 | $p1->value->SetFont(FF_ARIAL,FS_NORMAL,12); |
---|
25 | $p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct")); |
---|
26 | |
---|
27 | $graph->Add($p1); |
---|
28 | $graph->Stroke(); |
---|
29 | |
---|
30 | ?> |
---|
31 | |
---|
32 | |
---|
Note: See
TracBrowser
for help on using the repository browser.