source: trunk/xgraph/jpgraph/Examples/pieex9.php @ 42

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 816 bytes
Line 
1<?php // content="text/plain; charset=utf-8"
2require_once ('jpgraph/jpgraph.php');
3require_once ('jpgraph/jpgraph_pie.php');
4
5$data = array(40,60,31,35);
6
7// A new pie graph
8$graph = new PieGraph(250,200);
9$graph->SetShadow();
10
11// Title setup
12$graph->title->Set("Exploding all slices");
13$graph->title->SetFont(FF_FONT1,FS_BOLD);
14
15// Setup the pie plot
16$p1 = new PiePlot($data);
17
18// Adjust size and position of plot
19$p1->SetSize(0.35);
20$p1->SetCenter(0.5,0.52);
21
22// Setup slice labels and move them into the plot
23$p1->value->SetFont(FF_FONT1,FS_BOLD);
24$p1->value->SetColor("darkred");
25$p1->SetLabelPos(0.65);
26
27// Explode all slices
28$p1->ExplodeAll(10);
29
30// Add drop shadow
31$p1->SetShadow();
32
33// Finally add the plot
34$graph->Add($p1);
35
36// ... and stroke it
37$graph->Stroke();
38
39?>
Note: See TracBrowser for help on using the repository browser.