Ajout légende
This commit is contained in:
parent
7d878acbf8
commit
1317137561
@ -311,6 +311,10 @@ $graph->barcolor = "yellow";
|
|||||||
$xdatas[0] = array($cout_vente_prelev, $cout_vente_autre);
|
$xdatas[0] = array($cout_vente_prelev, $cout_vente_autre);
|
||||||
$xdatas[1] = array($cout_achat);
|
$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->add_datas($xdatas);
|
||||||
|
|
||||||
$graph->GraphDraw($file, $labels, $cout_vente);
|
$graph->GraphDraw($file, $labels, $cout_vente);
|
||||||
|
|||||||
@ -34,6 +34,8 @@ class GraphBarAccumul extends DolibarrGraph {
|
|||||||
$this->showframe = true;
|
$this->showframe = true;
|
||||||
$this->datas = array();
|
$this->datas = array();
|
||||||
|
|
||||||
|
$this->legend = array();
|
||||||
|
|
||||||
$this->datas_color[0][0] = "green";
|
$this->datas_color[0][0] = "green";
|
||||||
$this->datas_color[0][1] = "yellow";
|
$this->datas_color[0][1] = "yellow";
|
||||||
$this->datas_color[0][2] = "blue";
|
$this->datas_color[0][2] = "blue";
|
||||||
@ -112,6 +114,10 @@ class GraphBarAccumul extends DolibarrGraph {
|
|||||||
{
|
{
|
||||||
$b1plot = new BarPlot($this->datas[$j][$i]);
|
$b1plot = new BarPlot($this->datas[$j][$i]);
|
||||||
$b1plot->SetFillColor($this->datas_color[$j][$i]);
|
$b1plot->SetFillColor($this->datas_color[$j][$i]);
|
||||||
|
|
||||||
|
|
||||||
|
$b1plot->SetLegend($this->legend[$j][$i]);
|
||||||
|
|
||||||
|
|
||||||
array_push($accs, $b1plot);
|
array_push($accs, $b1plot);
|
||||||
}
|
}
|
||||||
@ -124,6 +130,11 @@ class GraphBarAccumul extends DolibarrGraph {
|
|||||||
|
|
||||||
$gbplot = new GroupBarPlot ($gbspl);
|
$gbplot = new GroupBarPlot ($gbspl);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Adjust the legend position
|
||||||
|
$graph->legend->Pos(0.14,0.14,"left","center");
|
||||||
|
|
||||||
$graph->Add($gbplot);
|
$graph->Add($gbplot);
|
||||||
|
|
||||||
// Display the graph
|
// Display the graph
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user