Ignore:
Timestamp:
Sep 28, 2010, 7:34:40 PM (11 years ago)
Author:
goya
Message:

graphe d'accueil

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/plot/templates/generatePlotGroupesSuccess.php

    r1463 r1472  
    11<?php
    22
    3 $data = unserialize(get_component('plot', 'groupesData'));
     3$data = unserialize(get_component('plot', 'getGroupesData'));
     4$xsize = 433; $ysize = 300 ; $font = 8;
    45
    5 $data['groupes'];
    6 $data['totaux'];
    7 $data['titres'];
    8 
    9 $n = count($data['titres']);
    10 
    11 $xsize = 390;
    12 $xtitre = 80; $ysize = 300; $ylegend = 145; $x0 = 140; $y0 = 112;
    13 $ticks = 12.5;
    14 $scale = 14;
    15 
    16 if ($drawAction === "map" ) { 
    17   $Test = new xsPChart(800,$size); 
     6if ($drawAction === "map") { 
     7  $Test = new xsPChart($xsize,$ysize); 
    188  $Test->getImageMap($mapId);
    199}
     
    2111$DataSet = new xsPData();
    2212$DataSet->AddPoint($data['titres'], "Serie1");
    23 $DataSet->AddPoint($presences, "Serie2");
    24 $DataSet->AddPoint($participations, "Serie3");
    25 $DataSet->AddPoint($mots, "Serie4");
    26 $DataSet->AddSerie("Serie2");
    27 $DataSet->AddSerie("Serie3");
    28 $DataSet->AddSerie("Serie4");
     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}
    2921$DataSet->SetAbsciseLabelSerie("Serie1");
    30 $DataSet->SetYAxisName("Séances par semaine");
    31 
    32 $DataSetLegend = new xsPData();
    33 $DataSetLegend->AddPoint($data['labels'], "Serie1");
    34 $DataSetLegend->AddPoint($presences, "Serie2");
    35 $DataSetLegend->AddPoint($participations, "Serie3");
    36 $DataSetLegend->AddSerie("Serie2");
    37 $DataSetLegend->AddSerie("Serie3");
    38 $DataSetLegend->SetSerieName(utf8_decode('Présences'),"Serie2");
    39 $DataSetLegend->SetSerieName("Participations","Serie3");
    40 $DataSetLegend->SetAbsciseLabelSerie("Serie1");
    41 
    42 $DataSetBordure = new xsPData();
    43 $DataSetBordure->AddPoint($data['labels'], "Serie1");
    44 $DataSetBordure->AddPoint($presences, "Serie2");
    45 $DataSetBordure->AddPoint(array_fill(1, count($data['labels']), 0), "Serie5");
    46 $DataSetBordure->AddSerie("Serie2");
    47 $DataSetBordure->AddSerie("Serie5");
    48 $DataSetBordure->SetAbsciseLabelSerie("Serie1");
     22$DataSet->SetYAxisUnit(" %");
    4923
    5024$DataSet2 = new xsPData();
    51 $DataSet2->AddPoint($data['labels'], "Serie1");
    52 $DataSet2->AddPoint($data['vacances'], "Serie6");
    53 $DataSet2->AddSerie("Serie6");
    54 $DataSet2->SetAbsciseLabelSerie("Serie1");
    55 
    56 if ($questions === 'true' && $type != 'commission') {
    57   $DataSet3 = new xsPData();
    58   $DataSet3->AddPoint($data['labels'], "Serie1");
    59   $DataSet3->AddPoint($data['n_questions'], "Serie7");
    60   $DataSet3->AddSerie("Serie7");
    61   $DataSet3->SetAbsciseLabelSerie("Serie1");
    62   $Data3 = $DataSet3->GetData();
    63   $DataDescr3 = $DataSet3->GetDataDescription();
    64 }
     25$DataSet2->AddPoint($data['totaux'], "Serie".$ct);
     26$DataSet2->SetAbsciseLabelSerie("Serie".$ct);
     27$DataSet2->SetYAxisUnit(" %");
    6528
    6629$Data = $DataSet->GetData();
    6730$DataDescr = $DataSet->GetDataDescription();
    68 $DataBordure = $DataSetBordure->GetData();
    69 $DataDescrBordure = $DataSetBordure->GetDataDescription();
    70 $Data2 = $DataSet2->GetData();
     31$Data2 = $DataSet2->getData();
    7132$DataDescr2 = $DataSet2->GetDataDescription();
    72 $DataLegend = $DataSetLegend->GetData();
    73 $DataDescrLegend = $DataSetLegend->GetDataDescription();
    7433
    75 $Test = new xsPChart(800,$size);
    76 $Test->setGraphArea(25+3*$font,3*$font,780,$size-10-2*$font);
    77 $Test->drawFilledRoundedRectangle(7,7,793,$size-7,5,240,240,240);
    78 $Test->drawRoundedRectangle(5,5,795,$size - 5,5,230,230,230);
    79 $Test->drawGraphArea(230,230,230,FALSE);
    80 $Test->setFixedScale(0,$scale,$scale/$ticks);
     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);
    8139$Test->xsSetFontProperties("tahoma.ttf",$font);
    82 $Test->drawScale($Data,$DataDescr,SCALE_NORMAL,50,50,50,TRUE,0,0,FALSE,1,TRUE);
    83 if ($link === 'true') {
    84   $Test->setColorPalette(0,255,255,255);
    85   $Test->setColorPalette(1,255,255,255);
    86   $Test->setImageMap(TRUE,$mapId);
    87   $Test->drawOverlayBarGraph($DataLegend,$DataDescrLegend,30,100);
    88   $Test->setImageMap(FALSE,$mapId);
    89 
    90 $Test->drawGrid(0,TRUE,0,0,0,100);
    91 $Test->setColorPalette(0,50,50,50);
    92 $Test->drawOverlayBarGraph($Data2,$DataDescr2,30,100);
    93 $Test->setColorPalette(0,255,0,0);
    94 $Test->setColorPalette(1,255,255,0);
    95 $Test->setColorPalette(2,0,255,0);
    96 $Test->drawFilledLineGraph($Data,$DataDescr,78);
    97 if ($questions === 'true' && $type != 'commission') {
    98   $Test->setColorPalette(0,0,0,255);
    99   $Test->drawOverlayBarGraph($Data3,$DataDescr3,85,25);
    100 }
    101 $Test->setColorPalette(0,255,0,0);
    102 $Test->setColorPalette(1,0,0,0);
    103 $Test->drawLineGraph($DataBordure,$DataDescrBordure);
     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);
    10452
    105 $Test->xsSetFontProperties("tahoma.ttf",$font + 3);
    106 $pos_titre = 240;
    107 if ($time === 'lastyear') {
    108   if (isset($data['mandat_clos'])) {
    109     $pos_titre = 210;
    110     $duree = ' sa dernière année de mandat';
    111   } else $duree = 's 12 derniers mois';
    112   $shortduree = 'annee';
    113 } else {
    114   $duree = " la session ".preg_replace('/^(\d{4})/', '\\1-', $time);
    115   $shortduree = $time;
    116 }
    117 if ($type === 'total') {
    118   $Test->drawTitle($pos_titre,3 + 2*$font,"Participation globale au cours de".$duree." (hémicycle et commissions)",50,50,50,585);
    119   $titre = 'globale-'.$shortduree;
    120 } else {
    121   $titre = $type;
    122   if ($type === 'commission') $titre .= 's';
    123   $Test->drawTitle($pos_titre+30,3 + 2*$font,"Participation en ".$titre." au cours de".$duree,50,50,50,585);
    124   $titre .= '-'.$shortduree;
    125 }
    126 if ($link === 'true')
    127   $Test->setImageMap(TRUE,$mapId);
     53//$Test->drawTitle($pos_titre,3 + 2*$font,"Participation globale au cours de".$duree." (hémicycle et commissions)",50,50,50,585);
    12854
    12955$Test->xsStroke();
Note: See TracChangeset for help on using the changeset viewer.