[2] | 1 | <?php
|
---|
| 2 | include ("jpgraph.php");
|
---|
| 3 | include ("jpgraph_line.php");
|
---|
| 4 |
|
---|
| 5 | $titvoti=$_GET['titvoti'];
|
---|
| 6 | $titperc=$_GET['titperc'];
|
---|
| 7 | $altro=$_GET['altro'];
|
---|
| 8 | $desc=$_GET['desc'];
|
---|
| 9 | $grp1=$_GET['grp1'];$grp2=$_GET['grp2'];$grp3=$_GET['grp3'];
|
---|
| 10 |
|
---|
| 11 | $ar1=$_GET['ar1'];$ar2=$_GET['ar2'];$ar3=$_GET['ar3'];
|
---|
| 12 |
|
---|
| 13 | $ar1=unserialize(stripslashes($ar1));
|
---|
| 14 | $ar2=unserialize(stripslashes($ar2));
|
---|
| 15 | $ar3=unserialize(stripslashes($ar3));
|
---|
| 16 | $desc=unserialize(stripslashes($desc));
|
---|
| 17 |
|
---|
| 18 |
|
---|
| 19 |
|
---|
| 20 | $graph = new Graph(640,320,"auto");
|
---|
| 21 | $graph->img->SetMargin(40,40,40,40);
|
---|
| 22 |
|
---|
| 23 | $graph->img->SetAntiAliasing();
|
---|
| 24 | $graph->SetScale("textlin");
|
---|
| 25 | $graph->SetShadow();
|
---|
| 26 | $graph->title->Set($titvoti);
|
---|
| 27 | $graph->title->SetFont(FF_FONT1,FS_BOLD);
|
---|
| 28 |
|
---|
| 29 | // Add 10% grace to top and bottom of plot
|
---|
| 30 | $graph->yscale->SetGrace(20,20);
|
---|
| 31 | $graph->xscale->SetGrace(20,20);
|
---|
| 32 | $graph->xaxis-> SetTickLabels($desc);
|
---|
| 33 | $graph->legend->Pos(0.03,0.2,"right","center");
|
---|
| 34 |
|
---|
| 35 |
|
---|
| 36 | $graph->SetBackgroundImage("../images/logo.jpg",BGIMG_COPY);
|
---|
| 37 | //$graph->SetBackgroundCountryFlag('ital',BGIMG_COPY,20);
|
---|
| 38 |
|
---|
| 39 | if($grp1){
|
---|
| 40 | $p1 = new LinePlot($ar1);
|
---|
| 41 | $p1->value-> Show();
|
---|
| 42 | $p1->value->SetFormat( "%0.0f");
|
---|
| 43 | $p1->mark->SetType(MARK_FILLEDCIRCLE);
|
---|
| 44 | $p1->mark->SetFillColor("red");
|
---|
| 45 | $p1->mark->SetWidth(4);
|
---|
| 46 | $p1->SetColor("blue");
|
---|
| 47 | $p1->SetCenter();
|
---|
| 48 | $p1->SetLegend($grp1);
|
---|
| 49 | }
|
---|
| 50 | if($grp2){
|
---|
| 51 | $p2 = new LinePlot($ar2);
|
---|
| 52 | $p2->value->SetFormat( "%0.0f");
|
---|
| 53 | $p2->value-> Show();
|
---|
| 54 | $p2->mark->SetType(MARK_FILLEDCIRCLE);
|
---|
| 55 | $p2->mark->SetFillColor("gray");
|
---|
| 56 | $p2->mark->SetWidth(4);
|
---|
| 57 | $p2->SetColor("black");
|
---|
| 58 | $p2->SetCenter();
|
---|
| 59 | $p2->SetLegend($grp2);
|
---|
| 60 | }
|
---|
| 61 | if($grp3){
|
---|
| 62 | $p3 = new LinePlot($ar3);
|
---|
| 63 | $p3->value->SetFormat( "%0.0f");
|
---|
| 64 | $p3->value-> Show();
|
---|
| 65 | $p3->mark->SetType(MARK_FILLEDCIRCLE);
|
---|
| 66 | $p3->mark->SetFillColor("green");
|
---|
| 67 | $p3->mark->SetWidth(4);
|
---|
| 68 | $p3->SetColor("red");
|
---|
| 69 | $p3->SetCenter();
|
---|
| 70 | $p3->SetLegend($altro);
|
---|
| 71 | }
|
---|
| 72 |
|
---|
| 73 | if($grp1)$graph->Add($p1);
|
---|
| 74 |
|
---|
| 75 | if($grp2)$graph->Add($p2);
|
---|
| 76 | if($grp3)$graph->Add($p3);
|
---|
| 77 |
|
---|
| 78 | $graph->Stroke();
|
---|
| 79 |
|
---|
| 80 |
|
---|
| 81 |
|
---|
| 82 |
|
---|
| 83 |
|
---|
| 84 | ?>
|
---|
| 85 |
|
---|
| 86 |
|
---|