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 3 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 3D pie plot
|
---|
20 | $p1 = new PiePlot3d($data);
|
---|
21 | $p1->SetTheme("sand");
|
---|
22 | $p1->SetCenter(0.4);
|
---|
23 | $p1->SetSize(80);
|
---|
24 |
|
---|
25 | // Adjust projection angle
|
---|
26 | $p1->SetAngle(45);
|
---|
27 |
|
---|
28 | // As a shortcut you can easily explode one numbered slice with
|
---|
29 | $p1->ExplodeSlice(3);
|
---|
30 |
|
---|
31 | // Setup the slice values
|
---|
32 | $p1->value->SetFont(FF_ARIAL,FS_BOLD,11);
|
---|
33 | $p1->value->SetColor("navy");
|
---|
34 |
|
---|
35 | $p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct"));
|
---|
36 |
|
---|
37 | $graph->Add($p1);
|
---|
38 | $graph->Stroke();
|
---|
39 |
|
---|
40 | ?>
|
---|
41 |
|
---|
42 |
|
---|