From: Dan Vanderkam Date: Mon, 14 Dec 2009 13:25:46 +0000 (-0800) Subject: fix another 0 vs. null bug X-Git-Tag: v1.0.0~784 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=d12999d3dc6c8f232255236b1b28b5b694a8fbfe;p=dygraphs.git fix another 0 vs. null bug --- 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; }