From af4cad8b49bb40b7f334f0cbafc77eef87438bd3 Mon Sep 17 00:00:00 2001
From: Neal Nelson <neal@makalumedia.com>
Date: Fri, 8 Oct 2010 14:08:49 +0200
Subject: [PATCH] Ignore data series' with null data for the purposes of auto
 scaling.

---
 dygraph.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dygraph.js b/dygraph.js
index 8d171e3..98d297a 100644
--- a/dygraph.js
+++ b/dygraph.js
@@ -1666,8 +1666,8 @@ Dygraph.prototype.drawGraph_ = function(data) {
     var extremes = this.extremeValues_(series);
     var thisMinY = extremes[0];
     var thisMaxY = extremes[1];
-    if (minY === null || thisMinY < minY) minY = thisMinY;
-    if (maxY === null || thisMaxY > maxY) maxY = thisMaxY;
+    if (minY === null || (thisMinY != null && thisMinY < minY)) minY = thisMinY;
+    if (maxY === null || (thisMaxY != null && thisMaxY > maxY)) maxY = thisMaxY;
 
     if (bars) {
       for (var j=0; j<series.length; j++) {
-- 
2.7.4