Skip to content

Commit

Permalink
Changed the condition on append to reject only NaN but not strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Franco Bottero committed Nov 26, 2019
1 parent 0449df6 commit b542507
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions smoothie.js
Expand Up @@ -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
Expand Down Expand Up @@ -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 || ''
Expand Down

0 comments on commit b542507

Please sign in to comment.