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