projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Syntax error, plus used correct function for y axis ranges.
[dygraphs.git]
/
dygraph.js
diff --git
a/dygraph.js
b/dygraph.js
index
c24f4f3
..
e28c273
100644
(file)
--- a/
dygraph.js
+++ b/
dygraph.js
@@
-1086,8
+1086,7
@@
Dygraph.prototype.doZoomXDates_ = function(minDate, maxDate) {
this.dateWindow_ = [minDate, maxDate];
this.drawGraph_();
if (this.attr_("zoomCallback")) {
this.dateWindow_ = [minDate, maxDate];
this.drawGraph_();
if (this.attr_("zoomCallback")) {
- var yRange = this.yAxisRange();
- this.attr_("zoomCallback")(minDate, maxDate, yRange[0], yRange[1]);
+ this.attr_("zoomCallback")(minDate, maxDate, this.yAxisRanges());
}
};
}
};
@@
-2413,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);
// 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;
};
var xParser;
@@
-2645,6
+2645,11
@@
Dygraph.prototype.parseDataTable_ = function(data) {
if (ret.length > 0 && row[0] < ret[ret.length - 1][0]) {
outOfOrder = true;
}
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);
}
ret.push(row);
}