From 067759bf04651661ad311cc2766e19ecc43470e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Mar 2020 20:22:46 +0100 Subject: [PATCH] Fix graph for lines --- htdocs/core/class/dolgraph.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 0e87475ee70..e2f9c501bc1 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1168,11 +1168,11 @@ class DolGraph $this->stringtoshow .= 'scales: { xAxes: [{ '; //$this->stringtoshow .= 'type: \'time\', '; // Need Moment.js $this->stringtoshow .= 'distribution: \'linear\''; - if (count($arrayofgroupslegend) > 0) { + if ($type == 'bar' && count($arrayofgroupslegend) > 0) { $this->stringtoshow .= ', stacked: true'; } $this->stringtoshow .= ' }]'; - if (count($arrayofgroupslegend) > 0) { + if ($type == 'bar' && count($arrayofgroupslegend) > 0) { $this->stringtoshow .= ', yAxes: [{ stacked: true }]'; } $this->stringtoshow .= ' }'; @@ -1259,7 +1259,7 @@ class DolGraph $this->stringtoshow .= 'label: \''.dol_escape_js(dol_string_nohtmltag($textoflegend)).'\', '; $this->stringtoshow .= 'pointStyle: \''.($this->type[$i] == 'linesnopoint' ? 'line' : 'circle').'\', '; $this->stringtoshow .= 'fill: '.($type == 'bar' ? 'true' : 'false').', '; - $this->stringtoshow .= 'borderWidth: \'1\', '; + if ($type == 'bar') { $this->stringtoshow .= 'borderWidth: \'1\', '; } $this->stringtoshow .= 'borderColor: \''.$bordercolor.'\', '; $this->stringtoshow .= 'backgroundColor: \''.$color.'\', '; if ($arrayofgroupslegend[$i]) $this->stringtoshow .= 'stack: \''.$arrayofgroupslegend[$i]['stacknum'].'\', ';