From 731bb6ba03cebddac34213550cce6a729b51ecd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 18 Dec 2014 09:12:36 +0100 Subject: [PATCH] Graph: hover tooltip and axis format units fix, bug introduced last week --- src/app/panels/graph/graph.tooltip.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/app/panels/graph/graph.tooltip.js b/src/app/panels/graph/graph.tooltip.js index 9100fed47cf..9e750cb6a9c 100644 --- a/src/app/panels/graph/graph.tooltip.js +++ b/src/app/panels/graph/graph.tooltip.js @@ -70,7 +70,11 @@ function ($) { for (i = 0; i < seriesList.length; i++) { series = seriesList[i]; - if (!series.data.length) { continue; } + + if (!series.data.length) { + results.push({ hidden: true }); + continue; + } if (scope.panel.stack) { if (scope.panel.tooltip.value_type === 'individual') { @@ -99,9 +103,9 @@ function ($) { lasthoverIndex = hoverIndex; } - results.push({ value: value, hoverIndex: newhoverIndex, series: series }); + results.push({ value: value, hoverIndex: newhoverIndex}); } else { - results.push({ value: value, hoverIndex: hoverIndex, series: series }); + results.push({ value: value, hoverIndex: hoverIndex}); } } @@ -150,7 +154,12 @@ function ($) { for (i = 0; i < seriesHoverInfo.length; i++) { hoverInfo = seriesHoverInfo[i]; - series = hoverInfo.series; + + if (hoverInfo.hidden) { + continue; + } + + series = seriesList[i]; value = series.formatValue(hoverInfo.value); seriesHtml += '
';