1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
$graph = new Graph(800,500);
$graph->SetFrame(false);//bordure graphique
$graph->SetScale("textlin",0,10);
$graph->SetAxisStyle(AXSTYLE_SIMPLE);
$graph->SetBackgroundGradient('#EFF7F9','#FFFFFF',GRAD_MIDVER,BGRAD_PLOT);
$graph->xaxis->SetColor('#444444'); // couleur de la police
$graph->xaxis->SetFont(FF_TREBUCHE,FS_NORMAL,10); // font family, size ...
$graph->SetMarginColor('#EFF7F9'); // couleur arriere plan
$graph->Set90AndMargin(480,20,45,85);//taille texte gauche, marge droite, marge haut, marge bas
$graph->xaxis->SetTickLabels($question);
$graph->title->SetFont(FF_TREBUCHE,FS_BOLD,12);
$graph->title->Set($nom_dim);
$graph->title->SetColor('#4CA3BC');
$graph->legend->Pos(0.3,0.87);
$graph->legend->SetFont(FF_TREBUCHE,FS_NORMAL,9);
$graph->legend->SetLayout(LEGEND_HOR);
$bplot1 = new BarPlot($autoeval); // reponse pour 1er statut ( auto eval )
$bplot1->SetLegend("Auto-évalué");
$bplot2 = new BarPlot($collabo); // reponse pour 2nd statut ( collabo )
$bplot2->SetLegend("Collaborateurs");
$bplot3 = new BarPlot($superieur);
$bplot3->SetLegend("Supérieurs");
$bplot4 = new BarPlot($pairs);
$bplot4->SetLegend("Pairs");
//$bplot1->SetPattern(PATTERN_STRIPE1,'#058DE8' ); //Diagonales dans barre
$bplot1->SetFillGradient("#F36B08","#F8BD08",GRAD_RIGHT_REFLECTION);
$bplot2->SetFillGradient("#46A6C1","#82E0FA",GRAD_RIGHT_REFLECTION);
$bplot3->SetFillGradient("#9D9E9A","#F2F5EC",GRAD_RIGHT_REFLECTION);
$bplot4->SetFillGradient("#DC56C4","#F8ABEA",GRAD_RIGHT_REFLECTION);
$graph->legend->SetFrameWeight(0);
$graph->legend->SetLineSpacing(15); //espacement legende
$gbarplot = new GroupBarPlot(array($bplot1,$bplot2,$bplot3,$bplot4));
$gbarplot->SetWidth(0.8);
$graph->Add($gbarplot);
$graph->Stroke('_image.png');
echo "<center><img src=\"_image.png?v=$n\"></center><br />";
//$n est issue de : $n=rand(100, 9999); |
Partager