Line | |
---|
1 | <?php // content="text/plain; charset=utf-8"
|
---|
2 | require_once ('jpgraph/jpgraph.php');
|
---|
3 | require_once ('jpgraph/jpgraph_pie.php');
|
---|
4 |
|
---|
5 | // Some data
|
---|
6 | $data = array(113,5,160,3,15,10,1);
|
---|
7 |
|
---|
8 | // Create the Pie Graph.
|
---|
9 | $graph = new PieGraph(300,200);
|
---|
10 | $graph->SetShadow();
|
---|
11 |
|
---|
12 | // Set A title for the plot
|
---|
13 | $graph->title->Set("Example 1 Pie plot");
|
---|
14 | $graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
|
---|
15 | $graph->title->SetColor("brown");
|
---|
16 |
|
---|
17 | // Create pie plot
|
---|
18 | $p1 = new PiePlot($data);
|
---|
19 | //$p1->SetSliceColors(array("red","blue","yellow","green"));
|
---|
20 | $p1->SetTheme("earth");
|
---|
21 |
|
---|
22 | $p1->value->SetFont(FF_ARIAL,FS_NORMAL,10);
|
---|
23 | // Set how many pixels each slice should explode
|
---|
24 | $p1->Explode(array(0,15,15,25,15));
|
---|
25 |
|
---|
26 |
|
---|
27 | $graph->Add($p1);
|
---|
28 | $graph->Stroke();
|
---|
29 |
|
---|
30 | ?>
|
---|
31 |
|
---|
32 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.