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 43 44 45 46
| //création du graphique
$graph = new Graph(510,370,'auto');
$graph->SetScale("textlin");
$graph->SetShadow();
//90 degrés et marges
$graph->Set90AndMargin(100,30,60,30);
//axe des abscisses
$graph->xaxis->SetTickLabels($tableauStatuts);
//$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,11);
$graph->xgrid->Show(true,true);
//marges pour les étiquettes
//par rapport au bord droit du graphique
$graph->xaxis->SetLabelMargin(10);
//axe des ordonnées
$graph->yaxis->scale->SetGrace(20);
//angle des étiquettes
$graph->yaxis->SetLabelAngle(45);
$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL, 8);
//création de l'histogramme
$histo = new BarPlot($tableauEffectif);
//couleurs des barres
$histo->SetFillColor(array("green","red", "blue", "yellow"));
//ombre
$histo->SetShadow();
//épaisseur des histogrammes
$histo->SetWidth(0.5);
// Valeurs
$histo->value->Show();
$histo->value->SetFont(FF_ARIAL,FS_BOLD,12);
$histo->value->SetColor("blue");
//ajout de l'histo au graph
$graph->Add($histo);
//titre
$graph->title->Set("AUVERGNE");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Afficher
$graph->Stroke("histoStatutAuvergne.png"); |
Partager