From 902091b8b33555845682681f64048f7ed1811c27 Mon Sep 17 00:00:00 2001 From: Marcus Lewis Date: Wed, 4 May 2016 20:03:36 -0700 Subject: [PATCH] Bugfix: Unwanted drawn point when prevCanvasX is 0 --- src/dygraph-canvas.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dygraph-canvas.js b/src/dygraph-canvas.js index 7ba66ff..bd37e67 100644 --- a/src/dygraph-canvas.js +++ b/src/dygraph-canvas.js @@ -220,18 +220,18 @@ DygraphCanvasRenderer._drawSeries = function(e, prevCanvasX = prevCanvasY = null; } else { isIsolated = false; - if (drawGapPoints || !prevCanvasX) { + if (drawGapPoints || prevCanvasX === null) { iter.nextIdx_ = i; iter.next(); nextCanvasY = iter.hasNext ? iter.peek.canvasy : null; var isNextCanvasYNullOrNaN = nextCanvasY === null || nextCanvasY != nextCanvasY; - isIsolated = (!prevCanvasX && isNextCanvasYNullOrNaN); + isIsolated = (prevCanvasX === null && isNextCanvasYNullOrNaN); if (drawGapPoints) { // Also consider a point to be "isolated" if it's adjacent to a // null point, excluding the graph edges. - if ((!first && !prevCanvasX) || + if ((!first && prevCanvasX === null) || (iter.hasNext && isNextCanvasYNullOrNaN)) { isIsolated = true; } -- 2.7.4