From ca4c62be56851bda4aa2716f5e4c1fba09c6c324 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Mar 2020 13:56:25 +0100 Subject: [PATCH] Fix var init --- htdocs/core/class/dolgraph.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index e2f9c501bc1..6511512d2ad 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1207,19 +1207,20 @@ class DolGraph $oldstacknum = -1; 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 if (is_array($arrayofgroupslegend[$i]) && count($arrayofgroupslegend[$i]) > 0) { // If we used a group by. $nbofcolorneeds = count($arrayofgroupslegend); $nbofcolorsavailable = count($theme_datacolor); if ($nbofcolorneeds > $nbofcolorsavailable) { - $usecolorvariantforgroypby = 1; + $usecolorvariantforgroupby = 1; } $textoflegend = $arrayofgroupslegend[$i]['legendwithgroup']; } else { $textoflegend = $this->Legend[$i]; } - if ($usecolorvariantforgroypby) { + if ($usecolorvariantforgroupby) { $newcolor = $this->datacolor[$arrayofgroupslegend[$i]['stacknum']]; // If we change the stack if ($oldstacknum == -1 || $arrayofgroupslegend[$i]['stacknum'] != $oldstacknum) {