Fix regression in color of bar for type = line

This commit is contained in:
Laurent Destailleur 2021-02-10 18:44:09 +01:00
parent 623d7b9819
commit a01301c500

View File

@ -1227,6 +1227,7 @@ class DolGraph
$this->stringtoshow .= ', stacked: true'; $this->stringtoshow .= ', stacked: true';
} }
$this->stringtoshow .= ' }] }'; $this->stringtoshow .= ' }] }';
// Add a callback to change label to show only positive value // Add a callback to change label to show only positive value
if (is_array($this->tooltipsLabels) || is_array($this->tooltipsTitles)) { if (is_array($this->tooltipsLabels) || is_array($this->tooltipsTitles)) {
$this->stringtoshow .= ', tooltips: { mode: \'nearest\', $this->stringtoshow .= ', tooltips: { mode: \'nearest\',
@ -1325,12 +1326,15 @@ class DolGraph
$color = $this->datacolor[$i]; $color = $this->datacolor[$i];
} }
if (is_array($this->bordercolor[$i])) { if (is_array($this->bordercolor[$i])) {
$color = 'rgb(' . $this->bordercolor[$i][0] . ', ' . $this->bordercolor[$i][1] . ', ' . $this->bordercolor[$i][2] . ', 0.9)';
} else {
if ($type != 'horizontalBar') {
$bordercolor = $color; $bordercolor = $color;
} else { } else {
$bordercolor = $this->bordercolor[$i]; $bordercolor = $this->bordercolor[$i];
} }
} }
}
if ($i > 0) $this->stringtoshow .= ', '; if ($i > 0) $this->stringtoshow .= ', ';
$this->stringtoshow .= "\n"; $this->stringtoshow .= "\n";
$this->stringtoshow .= '{'; $this->stringtoshow .= '{';