| Line | |
|---|
| 1 | <?php // content="text/plain; charset=utf-8"
|
|---|
| 2 | require_once ('jpgraph/jpgraph.php');
|
|---|
| 3 | require_once ('jpgraph/jpgraph_pie.php');
|
|---|
| 4 | // Some data
|
|---|
| 5 | $data = array(40,21,17,14,23);
|
|---|
| 6 |
|
|---|
| 7 | // Create the Pie Graph.
|
|---|
| 8 | $graph = new PieGraph(350,250);
|
|---|
| 9 |
|
|---|
| 10 | $theme_class="DefaultTheme";
|
|---|
| 11 | //$graph->SetTheme(new $theme_class());
|
|---|
| 12 |
|
|---|
| 13 | // Set A title for the plot
|
|---|
| 14 | $graph->title->Set("A Simple Pie Plot");
|
|---|
| 15 | $graph->SetBox(true);
|
|---|
| 16 |
|
|---|
| 17 | // Create
|
|---|
| 18 | $p1 = new PiePlot($data);
|
|---|
| 19 | $graph->Add($p1);
|
|---|
| 20 |
|
|---|
| 21 | $p1->ShowBorder();
|
|---|
| 22 | $p1->SetColor('black');
|
|---|
| 23 | $p1->SetSliceColors(array('#1E90FF','#2E8B57','#ADFF2F','#DC143C','#BA55D3'));
|
|---|
| 24 | $graph->Stroke();
|
|---|
| 25 |
|
|---|
| 26 | ?>
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.