Fix var init

This commit is contained in:
Laurent Destailleur 2020-03-09 13:56:25 +01:00
parent 788692f964
commit ca4c62be56

View File

@ -1207,19 +1207,20 @@ class DolGraph
$oldstacknum = -1; $oldstacknum = -1;
while ($i < $nblot) // Loop on each serie while ($i < $nblot) // Loop on each serie
{ {
$usecolorvariantforgroupby=0;
// We used a 'group by' and we have too many colors so we generated color variants per // We used a 'group by' and we have too many colors so we generated color variants per
if (is_array($arrayofgroupslegend[$i]) && count($arrayofgroupslegend[$i]) > 0) { // If we used a group by. if (is_array($arrayofgroupslegend[$i]) && count($arrayofgroupslegend[$i]) > 0) { // If we used a group by.
$nbofcolorneeds = count($arrayofgroupslegend); $nbofcolorneeds = count($arrayofgroupslegend);
$nbofcolorsavailable = count($theme_datacolor); $nbofcolorsavailable = count($theme_datacolor);
if ($nbofcolorneeds > $nbofcolorsavailable) { if ($nbofcolorneeds > $nbofcolorsavailable) {
$usecolorvariantforgroypby = 1; $usecolorvariantforgroupby = 1;
} }
$textoflegend = $arrayofgroupslegend[$i]['legendwithgroup']; $textoflegend = $arrayofgroupslegend[$i]['legendwithgroup'];
} else { } else {
$textoflegend = $this->Legend[$i]; $textoflegend = $this->Legend[$i];
} }
if ($usecolorvariantforgroypby) { if ($usecolorvariantforgroupby) {
$newcolor = $this->datacolor[$arrayofgroupslegend[$i]['stacknum']]; $newcolor = $this->datacolor[$arrayofgroupslegend[$i]['stacknum']];
// If we change the stack // If we change the stack
if ($oldstacknum == -1 || $arrayofgroupslegend[$i]['stacknum'] != $oldstacknum) { if ($oldstacknum == -1 || $arrayofgroupslegend[$i]['stacknum'] != $oldstacknum) {