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