From ab1cef6dd01f797252d875534429b4a5ceab6e81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Sep 2022 18:59:11 +0200 Subject: [PATCH] Can show all y serie value on a point in dolgraph --- htdocs/core/class/dolgraph.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index e24afd73879..57f0bca4e36 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -515,7 +515,7 @@ class DolGraph /** * Show pointvalue or not * - * @param int $showpointvalue 1=Show value for each point, as tooltip or inline (default), 0=Hide value + * @param int $showpointvalue 1=Show value for each point, as tooltip or inline (default), 0=Hide value, 2=Show values for each serie on same point * @return void */ public function setShowPointValue($showpointvalue) @@ -1299,8 +1299,12 @@ class DolGraph $type = 'line'; } + // Set options $this->stringtoshow .= 'var options = { maintainAspectRatio: false, aspectRatio: 2.5, '; $this->stringtoshow .= $xaxis; + if ($this->showpointvalue == 2) { + $this->stringtoshow .= 'interaction: { intersect: true, mode: \'index\'}, '; + } /* For Chartjs v2.9 */ /*