diff --git a/htdocs/telephonie/script/graph-statistiques-ca.php b/htdocs/telephonie/script/graph-statistiques-ca.php index 5d5fd7a2df3..5b9f87e0fe4 100644 --- a/htdocs/telephonie/script/graph-statistiques-ca.php +++ b/htdocs/telephonie/script/graph-statistiques-ca.php @@ -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); diff --git a/htdocs/telephonie/stats/graph/baraccumul.class.php b/htdocs/telephonie/stats/graph/baraccumul.class.php index 41a5d75ca95..0b6934eb1db 100644 --- a/htdocs/telephonie/stats/graph/baraccumul.class.php +++ b/htdocs/telephonie/stats/graph/baraccumul.class.php @@ -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