Line | |
---|
1 | <?php // content="text/plain; charset=utf-8"
|
---|
2 | require_once ('jpgraph/jpgraph.php');
|
---|
3 | require_once ('jpgraph/jpgraph_pie.php');
|
---|
4 |
|
---|
5 | $data = array(40,60,21,33);
|
---|
6 |
|
---|
7 | // Setup graph
|
---|
8 | $graph = new PieGraph(300,200);
|
---|
9 | $graph->SetShadow();
|
---|
10 |
|
---|
11 | // Setup graph title
|
---|
12 | $graph->title->Set("Example 5 of pie plot");
|
---|
13 | $graph->title->SetFont(FF_FONT1,FS_BOLD);
|
---|
14 |
|
---|
15 | // Create pie plot
|
---|
16 | $p1 = new PiePlot($data);
|
---|
17 | $p1->value->SetFont(FF_VERDANA,FS_BOLD);
|
---|
18 | $p1->value->SetColor("darkred");
|
---|
19 | $p1->SetSize(0.3);
|
---|
20 | $p1->SetCenter(0.4);
|
---|
21 | $p1->SetLegends(array("Jan","Feb","Mar","Apr","May"));
|
---|
22 | //$p1->SetStartAngle(M_PI/8);
|
---|
23 | $p1->ExplodeSlice(3);
|
---|
24 |
|
---|
25 | $graph->Add($p1);
|
---|
26 |
|
---|
27 | $graph->Stroke();
|
---|
28 |
|
---|
29 | ?>
|
---|
30 |
|
---|
31 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.