source: cpc/trunk/project/apps/frontend/modules/plot/templates/generatePlotGroupesSuccess.php @ 1472

Last change on this file since 1472 was 1472, checked in by goya, 11 years ago

graphe d'accueil

File size: 1.9 KB
Line 
1<?php
2
3$data = unserialize(get_component('plot', 'getGroupesData'));
4$xsize = 433; $ysize = 300 ; $font = 8;
5
6if ($drawAction === "map") { 
7  $Test = new xsPChart($xsize,$ysize); 
8  $Test->getImageMap($mapId);
9}
10
11$DataSet = new xsPData();
12$DataSet->AddPoint($data['titres'], "Serie1");
13$ct = 2;
14foreach ($data['groupes'] as $groupe => $values) {
15  $serie = "Serie".$ct;
16  $DataSet->AddPoint($values, $serie);
17  $DataSet->AddSerie($serie);
18  $DataSet->SetSerieName($groupe, $serie);
19  $ct++;
20}
21$DataSet->SetAbsciseLabelSerie("Serie1");
22$DataSet->SetYAxisUnit(" %");
23
24$DataSet2 = new xsPData();
25$DataSet2->AddPoint($data['totaux'], "Serie".$ct);
26$DataSet2->SetAbsciseLabelSerie("Serie".$ct);
27$DataSet2->SetYAxisUnit(" %");
28
29$Data = $DataSet->GetData();
30$DataDescr = $DataSet->GetDataDescription();
31$Data2 = $DataSet2->getData();
32$DataDescr2 = $DataSet2->GetDataDescription();
33
34$Test = new xsPChart($xsize,$ysize);
35$Test->setGraphArea(40+2*$font,15+4*$font,$xsize-20,$ysize-4*$font);
36$Test->drawFilledRectangle(7,7,$xsize-7,$ysize-7,240,240,240);
37$Test->drawGraphArea(190,190,190,FALSE);
38$Test->setFixedScale(0,100.7,4);
39$Test->xsSetFontProperties("tahoma.ttf",$font);
40$Test->drawScale($Data2,$DataDescr2,SCALE_NORMAL,50,50,50,TRUE,0,0,TRUE,1,FALSE);
41$Test->drawScale($Data,$DataDescr,SCALE_NORMAL,50,50,50,TRUE,16,0,TRUE,1,TRUE);
42$Test->xsSetFontProperties("tahoma.ttf",$font+1);
43$Test->drawTitle(4+2*$font,$ysize-4*$font+18, "TOTAL :",50,50,50);
44$Test->drawGrid(4,TRUE,0,0,0,40);
45$Test->setColorPalette(0,30,30,200);
46$Test->setColorPalette(1,30,190,255);
47$Test->setColorPalette(2,255,50,190);
48$Test->setColorPalette(3,255,30,30);
49$Test->setColorPalette(4,130,130,130);
50$Test->setImageMap(TRUE,$mapId);
51$Test->drawStackedBarGraph($Data,$DataDescr,75,90);
52
53//$Test->drawTitle($pos_titre,3 + 2*$font,"Participation globale au cours de".$duree." (hémicycle et commissions)",50,50,50,585);
54
55$Test->xsStroke();
56
57?>
Note: See TracBrowser for help on using the repository browser.