X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=1ed103c07e21926569d769b716a357c22390a196;hb=727439b43dccb8ffb42f5dba3ef3c7cdb3ae5a76;hp=7d64bb9d8e8ad7e370688db9a4c3a2b06134a9b9;hpb=f0f2aef666950ea136e1ede7bc286ccb07c2c6b6;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index 7d64bb9..1ed103c 100644 --- a/dygraph.js +++ b/dygraph.js @@ -37,7 +37,7 @@ And error bars will be calculated automatically using a binomial distribution. - For further documentation and examples, see http://www.danvk.org/dygraphs + For further documentation and examples, see http://dygraphs.com/ */ @@ -1086,7 +1086,7 @@ Dygraph.prototype.doZoomXDates_ = function(minDate, maxDate) { this.dateWindow_ = [minDate, maxDate]; this.drawGraph_(); if (this.attr_("zoomCallback")) { - this.attr_("zoomCallback")(minDate, maxDate, this.yAxisRange()); + this.attr_("zoomCallback")(minDate, maxDate, this.yAxisRanges()); } }; @@ -2412,7 +2412,8 @@ Dygraph.prototype.parseCSV_ = function(data) { // Parse the x as a float or return null if it's not a number. var parseFloatOrNull = function(x) { var val = parseFloat(x); - return isNaN(val) ? null : val; + // isFinite() returns false for NaN and +/-Infinity. + return isFinite(val) ? val : null; }; var xParser; @@ -2644,6 +2645,11 @@ Dygraph.prototype.parseDataTable_ = function(data) { if (ret.length > 0 && row[0] < ret[ret.length - 1][0]) { outOfOrder = true; } + + // Strip out infinities, which give dygraphs problems later on. + for (var j = 0; j < row.length; j++) { + if (!isFinite(row[j])) row[j] = null; + } ret.push(row); }