Ajout lgende

This commit is contained in:
Rodolphe Quiedeville 2005-06-16 15:53:55 +00:00
parent 7d878acbf8
commit 1317137561
2 changed files with 15 additions and 0 deletions

View File

@ -311,6 +311,10 @@ $graph->barcolor = "yellow";
$xdatas[0] = array($cout_vente_prelev, $cout_vente_autre);
$xdatas[1] = array($cout_achat);
$graph->legend[0][0] = "Factures prélevées";
$graph->legend[0][1] = "Factures non-prélevées";
$graph->legend[1][0] = "Coût fournisseur";
$graph->add_datas($xdatas);
$graph->GraphDraw($file, $labels, $cout_vente);

View File

@ -34,6 +34,8 @@ class GraphBarAccumul extends DolibarrGraph {
$this->showframe = true;
$this->datas = array();
$this->legend = array();
$this->datas_color[0][0] = "green";
$this->datas_color[0][1] = "yellow";
$this->datas_color[0][2] = "blue";
@ -112,6 +114,10 @@ class GraphBarAccumul extends DolibarrGraph {
{
$b1plot = new BarPlot($this->datas[$j][$i]);
$b1plot->SetFillColor($this->datas_color[$j][$i]);
$b1plot->SetLegend($this->legend[$j][$i]);
array_push($accs, $b1plot);
}
@ -124,6 +130,11 @@ class GraphBarAccumul extends DolibarrGraph {
$gbplot = new GroupBarPlot ($gbspl);
// Adjust the legend position
$graph->legend->Pos(0.14,0.14,"left","center");
$graph->Add($gbplot);
// Display the graph