| 1 |
lars |
1 |
<?php
|
|
|
2 |
include_once ("../jpgraph.php");
|
|
|
3 |
include_once ("../jpgraph_pie.php");
|
|
|
4 |
|
|
|
5 |
// Some data
|
|
|
6 |
$data = array(40,21,17,14,23);
|
|
|
7 |
|
|
|
8 |
// Create the Pie Graph.
|
|
|
9 |
$graph = new PieGraph(300,200,'auto');
|
|
|
10 |
$graph->SetShadow();
|
|
|
11 |
|
|
|
12 |
// Set A title for the plot
|
|
|
13 |
$graph->title->Set("Client side image map");
|
|
|
14 |
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
|
|
15 |
|
|
|
16 |
// Create
|
|
|
17 |
$p1 = new PiePlot($data);
|
|
|
18 |
$p1->SetCenter(0.4,0.5);
|
|
|
19 |
|
|
|
20 |
$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul"));
|
|
|
21 |
$targ=array("pie_csimex1.php#1","pie_csimex1.php#2","pie_csimex1.php#3",
|
|
|
22 |
"pie_csimex1.php#4","pie_csimex1.php#5","pie_csimex1.php#6");
|
|
|
23 |
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
|
|
|
24 |
$p1->SetCSIMTargets($targ,$alts);
|
|
|
25 |
|
|
|
26 |
$graph->Add($p1);
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
// Send back the HTML page which will call this script again
|
|
|
30 |
// to retrieve the image.
|
|
|
31 |
$graph->StrokeCSIM('pie_csimex1.php');
|
|
|
32 |
|
|
|
33 |
?>
|
|
|
34 |
|
|
|
35 |
|