| 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(40,60,21,33);
|
|---|
| 8 |
|
|---|
| 9 | // Create the Pie Graph.
|
|---|
| 10 | $graph = new PieGraph(350,250);
|
|---|
| 11 |
|
|---|
| 12 | $theme_class= new UniversalTheme;
|
|---|
| 13 | $graph->SetTheme($theme_class);
|
|---|
| 14 |
|
|---|
| 15 | // Set A title for the plot
|
|---|
| 16 | $graph->title->Set("A Simple 3D Pie Plot");
|
|---|
| 17 |
|
|---|
| 18 | // Create
|
|---|
| 19 | $p1 = new PiePlot3D($data);
|
|---|
| 20 | $graph->Add($p1);
|
|---|
| 21 |
|
|---|
| 22 | $p1->ShowBorder();
|
|---|
| 23 | $p1->SetColor('black');
|
|---|
| 24 | $p1->SetSliceColors(array('#1E90FF','#2E8B57','#ADFF2F','#BA55D3'));
|
|---|
| 25 | $p1->ExplodeSlice(1);
|
|---|
| 26 | $graph->Stroke();
|
|---|
| 27 |
|
|---|
| 28 | ?> |
|---|
Note:
See
TracBrowser
for help on using the repository browser.