source: trunk/client/modules/Elezioni/grafici/raffrontivoto.php@ 404

Last change on this file since 404 was 105, checked in by eol, 13 years ago

Sistemazione elementi grafici e di esportazione dati, stemma sui grafici (var nel config.php $ins_logo=0 per eliminare lo stemma).

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