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 | $a=$_GET['a'];$b=$_GET['b'];$c=$_GET['c'];$d=$_GET['d'];
|
---|
13 | $a1=$_GET['a1'];$b1=$_GET['b1'];$c1=$_GET['c1'];$d1=$_GET['d1'];
|
---|
14 | $titolo=$_GET['titolo'];
|
---|
15 | $cop=$_GET['cop'];
|
---|
16 | $logo=$_GET['logo'];
|
---|
17 | $data = array($a,$b,$c,$d);
|
---|
18 | $legend = array("$a $a1","$b $b1", "$c $c1", "$d $d1");
|
---|
19 | $graph = new PieGraph(350,250,"auto");
|
---|
20 | $graph->SetShadow();
|
---|
21 |
|
---|
22 |
|
---|
23 |
|
---|
24 | $graph->title->Set($titolo);
|
---|
25 | $graph->title->SetFont(FF_FONT1,FS_BOLD);
|
---|
26 | $graph ->legend->Pos( 0.52,0.50,"left" ,"center");
|
---|
27 | $graph->SetBackgroundGradient('white','yellow',GRAD_HOR,BGRAD_MARGIN);
|
---|
28 |
|
---|
29 | /*
|
---|
30 | $txt =new Text("$cop");
|
---|
31 | //$txt =new Text("$siteistat");
|
---|
32 | $txt->Pos( 2,180);
|
---|
33 | $txt->SetColor( "red");
|
---|
34 | $graph->AddText( $txt);
|
---|
35 | */
|
---|
36 | if(isset($logo)){
|
---|
37 | //if (file_exists("modules/Elezioni/images/".$logo.".png")) {
|
---|
38 | // $graph->SetBackgroundImage("../images/".$logo.".png",BGIMG_COPY);
|
---|
39 | }
|
---|
40 | /*
|
---|
41 | else{
|
---|
42 | else $graph->SetBackgroundImage("../images/vuoto.jpg",BGIMG_COPY);
|
---|
43 | }
|
---|
44 | */
|
---|
45 | // black-white
|
---|
46 | //$graph->AdjBackgroundImage(0.4,0.3,-1);
|
---|
47 |
|
---|
48 | $p1 = new PiePlot($data);
|
---|
49 | $p1->value->SetFormat('');
|
---|
50 | $p1->value->Show();
|
---|
51 | $p1->SetLegends($legend);
|
---|
52 | $p1->SetCenter(0.25,0.4);
|
---|
53 | $graph->Add($p1);
|
---|
54 | $graph->Stroke();
|
---|
55 |
|
---|
56 |
|
---|
57 |
|
---|
58 |
|
---|
59 |
|
---|
60 |
|
---|
61 | $graph->Add($p1);
|
---|
62 | $graph->Stroke();
|
---|
63 |
|
---|
64 |
|
---|
65 |
|
---|
66 |
|
---|
67 |
|
---|
68 | ?>
|
---|
69 |
|
---|
70 |
|
---|