From 0302e4f2b5839b514a7a93b088edc18e976cc910 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 00:29:25 +0100 Subject: [PATCH] Fix PhanPluginRedundantAssignment --- htdocs/core/class/dolgraph.class.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index d1743b8c733..215d9a9e0e0 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1,6 +1,7 @@ * Copyright (c) 2004-2015 Laurent Destailleur + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1288,7 +1289,6 @@ class DolGraph $this->stringtoshow .= '], datasets: ['; $i = 0; - $i = 0; while ($i < $nblot) { // Loop on each series $color = 'rgb(' . $this->datacolor[$i][0] . ', ' . $this->datacolor[$i][1] . ', ' . $this->datacolor[$i][2] . ')'; @@ -1310,11 +1310,7 @@ class DolGraph $type = 'bar'; $xaxis = ''; - if (!isset($this->type[$firstlot]) || $this->type[$firstlot] == 'bars') { - $type = 'bar'; - } if (isset($this->type[$firstlot]) && $this->type[$firstlot] == 'horizontalbars') { - $type = 'bar'; $xaxis = "indexAxis: 'y', "; } if (isset($this->type[$firstlot]) && ($this->type[$firstlot] == 'lines' || $this->type[$firstlot] == 'linesnopoint')) { @@ -1348,7 +1344,7 @@ class DolGraph $this->stringtoshow .= 'tooltip: { mode: \'nearest\', callbacks: {'; if (is_array($this->tooltipsTitles)) { - $this->stringtoshow .=' + $this->stringtoshow .= ' title: function(tooltipItem, data) { var tooltipsTitle ='.json_encode($this->tooltipsTitles).' return tooltipsTitle[tooltipItem[0].datasetIndex]; @@ -1360,7 +1356,7 @@ class DolGraph return tooltipslabels[tooltipItem.datasetIndex] }'; } - $this->stringtoshow .='}},'; + $this->stringtoshow .= '}},'; } $this->stringtoshow .= "}, \n"; @@ -1388,7 +1384,7 @@ class DolGraph $this->stringtoshow .= 'tooltips: { mode: \'nearest\', callbacks: {'; if (is_array($this->tooltipsTitles)) { - $this->stringtoshow .=' + $this->stringtoshow .= ' title: function(tooltipItem, data) { var tooltipsTitle ='.json_encode($this->tooltipsTitles).' return tooltipsTitle[tooltipItem[0].datasetIndex]; @@ -1400,7 +1396,7 @@ class DolGraph return tooltipslabels[tooltipItem.datasetIndex] }'; } - $this->stringtoshow .='}},'; + $this->stringtoshow .= '}},'; } $this->stringtoshow .= '};'; $this->stringtoshow .= '