1 | <?php
|
---|
2 | /************************************************************************/
|
---|
3 | /* Eleonline - Raccolta e diffusione dei dati elettorali */
|
---|
4 | /* by Luciano Apolito & Roberto Gigli */
|
---|
5 | /* http://www.eleonline.it */
|
---|
6 | /* info@eleonline.it luciano@aniene.net rgigli@libero.it */
|
---|
7 | /************************************************************************/
|
---|
8 |
|
---|
9 | include ("jpgraph.php");
|
---|
10 | include ("jpgraph_pie.php");
|
---|
11 |
|
---|
12 | $e=$_GET['e'];$f=$_GET['f'];$e1=$_GET['e1'];$f1=$_GET['f1'];
|
---|
13 | $titolo=$_GET['titolo'];
|
---|
14 | if (isset($_GET['cop'])) $cop=$_GET['cop'];else $cop='';
|
---|
15 | if (isset($_GET['x'])) $dim_x=$_GET['x']; else $dim_x='350';
|
---|
16 | if (isset($_GET['y'])) $dim_y=$_GET['y']; else $dim_y='200';
|
---|
17 | if (isset($_GET['logo'])) $logo=$_GET['logo'];else $logo='';
|
---|
18 | $data = array($e,$f);
|
---|
19 | $legend = array("$e $e1","$f $f1");
|
---|
20 | $graph = new PieGraph($dim_x,$dim_y,"auto");
|
---|
21 | $graph->SetShadow();
|
---|
22 |
|
---|
23 | $graph->title->Set($titolo);
|
---|
24 | $graph->title->SetFont(FF_FONT1,FS_BOLD);
|
---|
25 | $graph ->legend->Pos( 0.55,0.75,"left" ,"center");
|
---|
26 |
|
---|
27 | $graph->SetBackgroundImage("../images/$logo",BGIMG_COPY);
|
---|
28 |
|
---|
29 | $graph->SetBackgroundGradient('red','yellow',GRAD_HOR,BGRAD_MARGIN);
|
---|
30 |
|
---|
31 | $p1 = new PiePlot($data);
|
---|
32 | $p1->value->SetFormat('');
|
---|
33 | $p1->value->Show();
|
---|
34 | $p1->SetLegends($legend);
|
---|
35 | $p1->SetCenter(0.45,0.5);
|
---|
36 |
|
---|
37 | $graph->Add($p1);
|
---|
38 | $graph->Stroke();
|
---|
39 |
|
---|
40 | ?>
|
---|
41 |
|
---|
42 |
|
---|