Fix negative colors for bars

This commit is contained in:
Laurent Destailleur 2021-11-08 14:51:14 +01:00
parent c464a1cfd2
commit f4b2a6ec92

View File

@ -1431,6 +1431,14 @@ class DolGraph
$bordercolor = $this->bordercolor[$i];
}
}
// For negative colors, we invert border and background
$tmp = str_replace('#', '', $color);
if (strpos($tmp, '-') !== false) {
$foundnegativecolor++;
$bordercolor = str_replace('-', '', $color);
$color = '#FFFFFF'; // If $val is '-123'
}
}
if ($i > 0) {
$this->stringtoshow .= ', ';