From c1820e6d6ca3adb4f98acd69d7afedc3d732b900 Mon Sep 17 00:00:00 2001 From: Franco Bottero Date: Tue, 26 Nov 2019 14:14:19 -0300 Subject: [PATCH] Changed the condition on append to reject only NaN but not strings --- smoothie.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/smoothie.js b/smoothie.js index b54c436..758414d 100644 --- a/smoothie.js +++ b/smoothie.js @@ -210,7 +210,7 @@ */ TimeSeries.prototype.append = function(timestamp, value, sumRepeatedTimeStampValues) { // Reject NaN - if (isNaN(timestamp) || isNaN(value)){ + if (isNaN(timestamp) || (typeof value != string && isNaN(value))){ return } // Rewind until we hit an older timestamp @@ -339,7 +339,8 @@ /** Formats the HTML string content of the tooltip. */ SmoothieChart.tooltipFormatter = function (timestamp, data) { var timestampFormatter = this.options.timestampFormatter || SmoothieChart.timeFormatter, - lines = [timestampFormatter(new Date(timestamp))]; + lines = [timestampFormatter(new Date(timestamp))], + label; for (var i = 0; i < data.length; ++i) { label = data[i].series.options.tooltipLabel || ''