From d12999d3dc6c8f232255236b1b28b5b694a8fbfe Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Mon, 14 Dec 2009 05:25:46 -0800 Subject: [PATCH] fix another 0 vs. null bug --- dygraph.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dygraph.js b/dygraph.js index 7cf21ba..8895a39 100644 --- a/dygraph.js +++ b/dygraph.js @@ -569,10 +569,12 @@ Dygraph.prototype.createDragInterface_ = function() { dragStartX = getX(event); dragStartY = getY(event); - if (event.altKey && self.dateWindow_) { + if (event.altKey) { + if (!self.dateWindow_) return; // have to be zoomed in to pan. isPanning = true; dateRange = self.dateWindow_[1] - self.dateWindow_[0]; - draggingDate = (dragStartX / self.width_) * dateRange + self.dateWindow_[0]; + draggingDate = (dragStartX / self.width_) * dateRange + + self.dateWindow_[0]; } else { isZooming = true; } @@ -1154,7 +1156,7 @@ Dygraph.prototype.extremeValues_ = function(series) { } else { for (var j = 0; j < series.length; j++) { var y = series[j][1]; - if (!y) continue; + if (y === null || isNaN(y)) continue; if (maxY == null || y > maxY) { maxY = y; } -- 2.7.4