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
|
// Mes valeurs :
$datay=array(-190,-112,-101,-322,-193,-128,-15,-4,-69,-155,-140,-41,-17,171,300,353,260,265);
$annee=array(1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008);
// Create the graph.
$graph = new Graph(900,300,"auto");
$graph->img->SetMargin(40,30,30,40);
$graph->SetScale("textlin");
$graph->SetShadow();
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("orange");
// DIsplay value at top of each bar
$bplot->value->Show();
$bplot->SetShadow();
$bplot->value->SetFormat("%u"); // <-- J'ai rajouter cette ligne
$graph->Add($bplot);
// Position the scale at the min of the other axis
$graph->xaxis->SetPos("min");
// Add 10% more space at top and bottom of graph
$graph->yscale->SetGrace(7,7);
$graph->xaxis->title->Set("");
$graph->yaxis->title->Set("");
$graph->xaxis->SetTickLabels($annee);
$graph->title->SetFont(FF_FONT1,FS_NORMAL,12);
$graph->title->Set("Solde du commerce extérieur gardois");
$graph->yaxis->title->SetFont(FF_FONT1,FS_NORMAL,16);
$graph->Stroke(); |
Partager