From 411e20afd736993c570304cd3112b679419d4c86 Mon Sep 17 00:00:00 2001
From: "mathias.chouet" <mathias.chouet@irstea.fr>
Date: Mon, 3 Jun 2019 17:55:52 +0200
Subject: [PATCH] Correction petit bug dans les tooltips des graphiques

---
 .../results-graph/results-graph.component.ts           | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/app/components/results-graph/results-graph.component.ts b/src/app/components/results-graph/results-graph.component.ts
index 5cc0a4590..7e775c89a 100644
--- a/src/app/components/results-graph/results-graph.component.ts
+++ b/src/app/components/results-graph/results-graph.component.ts
@@ -204,11 +204,14 @@ export class ResultsGraphComponent extends ResultsComponent implements AfterCont
                 },
                 label: (tooltipItem, data) => {
                     const lines: string[] = [];
+                    const nbLines = that._results.getVariatingParametersSymbols().length;
                     for (const v of that._results.getVariatingParametersSymbols()) {
                         const series = that._results.getValuesSeries(v);
                         const line = v + " = " + series[tooltipItem.index].toFixed(nDigits);
                         if (v === this.chartX) {
-                            lines.unshift("");
+                            if (nbLines > 1) {
+                                lines.unshift("");
+                            }
                             lines.unshift(line);
                         } else {
                             lines.push(line);
@@ -277,11 +280,14 @@ export class ResultsGraphComponent extends ResultsComponent implements AfterCont
                 },
                 label: (tooltipItem, data) => {
                     const lines: string[] = [];
+                    const nbLines = that._results.getVariatingParametersSymbols().length;
                     for (const v of that._results.getVariatingParametersSymbols()) {
                         const series = that._results.getValuesSeries(v);
                         const line = v + " = " + series[tooltipItem.index].toFixed(nDigits);
                         if (v === this.chartX) {
-                            lines.unshift("");
+                            if (nbLines > 1) {
+                                lines.unshift("");
+                            }
                             lines.unshift(line);
                         } else {
                             lines.push(line);
-- 
GitLab