From cb04b7f4e2eb64a28159e83b25081d8050d47c78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 13 Mar 2015 09:27:08 +0100 Subject: [PATCH] Fixed issue with legend values when all values are negative and some are null, #1468 --- src/app/components/timeSeries.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/app/components/timeSeries.js b/src/app/components/timeSeries.js index fd7b9fe849a..c356ddea63b 100644 --- a/src/app/components/timeSeries.js +++ b/src/app/components/timeSeries.js @@ -86,17 +86,19 @@ function (_, kbn) { } } - if (_.isNumber(currentValue)) { - this.stats.total += currentValue; - this.allIsNull = false; - } + if (currentValue !== null) { + if (_.isNumber(currentValue)) { + this.stats.total += currentValue; + this.allIsNull = false; + } - if (currentValue > this.stats.max) { - this.stats.max = currentValue; - } + if (currentValue > this.stats.max) { + this.stats.max = currentValue; + } - if (currentValue < this.stats.min) { - this.stats.min = currentValue; + if (currentValue < this.stats.min) { + this.stats.min = currentValue; + } } result.push([currentTime, currentValue]);