projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #168 from jhollingsworth/master
[dygraphs.git]
/
dygraph.js
diff --git
a/dygraph.js
b/dygraph.js
index
c1764a1
..
621ea32
100644
(file)
--- a/
dygraph.js
+++ b/
dygraph.js
@@
-408,6
+408,12
@@
Dygraph.prototype.__init__ = function(div, file, attrs) {
// TODO(nikhilk): Add any other stackedGraph checks here.
}
// TODO(nikhilk): Add any other stackedGraph checks here.
}
+ // These two options have a bad interaction. See issue 359.
+ if (attrs.showRangeSelector && attrs.animatedZooms) {
+ this.warn('You should not set animatedZooms=true when using the range selector.');
+ attrs.animatedZooms = false;
+ }
+
// Dygraphs has many options, some of which interact with one another.
// To keep track of everything, we maintain two sets of options:
//
// Dygraphs has many options, some of which interact with one another.
// To keep track of everything, we maintain two sets of options:
//
@@
-1310,7
+1316,7
@@
Dygraph.prototype.createDragInterface_ = function() {
context.tarp.uncover();
};
context.tarp.uncover();
};
- this.addEvent(
window
, 'mouseup', this.mouseUpHandler_);
+ this.addEvent(
document
, 'mouseup', this.mouseUpHandler_);
};
/**
};
/**
@@
-1530,7
+1536,8
@@
Dygraph.prototype.doUnzoom_ = function() {
newValueRanges = [];
for (i = 0; i < this.axes_.length; i++) {
var axis = this.axes_[i];
newValueRanges = [];
for (i = 0; i < this.axes_.length; i++) {
var axis = this.axes_[i];
- newValueRanges.push(axis.valueRange !== null ?
+ newValueRanges.push((axis.valueRange !== null &&
+ axis.valueRange !== undefined) ?
axis.valueRange : axis.extremeRange);
}
}
axis.valueRange : axis.extremeRange);
}
}
@@
-2106,7
+2113,7
@@
Dygraph.prototype.extremeValues_ = function(series) {
// With custom bars, maxY is the max of the high values.
for (j = 0; j < series.length; j++) {
y = series[j][1][0];
// With custom bars, maxY is the max of the high values.
for (j = 0; j < series.length; j++) {
y = series[j][1][0];
- if (
!y
) continue;
+ if (
y === null || isNaN(y)
) continue;
var low = y - series[j][1][1];
var high = y + series[j][1][2];
if (low > y) low = y; // this can happen with custom bars,
var low = y - series[j][1][1];
var high = y + series[j][1][2];
if (low > y) low = y; // this can happen with custom bars,
@@
-2930,7
+2937,8
@@
Dygraph.prototype.parseFloat_ = function(x, opt_line_no, opt_line) {
*/
Dygraph.prototype.parseCSV_ = function(data) {
var ret = [];
*/
Dygraph.prototype.parseCSV_ = function(data) {
var ret = [];
- var lines = data.split("\n");
+ var line_delimiter = Dygraph.detectLineDelimiter(data);
+ var lines = data.split(line_delimiter || "\n");
var vals, j;
// Use the default delimiter or fall back to a tab if that makes sense.
var vals, j;
// Use the default delimiter or fall back to a tab if that makes sense.
@@
-3286,7
+3294,8
@@
Dygraph.prototype.start_ = function() {
this.predraw_();
} else if (typeof data == 'string') {
// Heuristic: a newline means it's CSV data. Otherwise it's an URL.
this.predraw_();
} else if (typeof data == 'string') {
// Heuristic: a newline means it's CSV data. Otherwise it's an URL.
- if (data.indexOf('\n') >= 0) {
+ var line_delimiter = Dygraph.detectLineDelimiter(data);
+ if (line_delimiter) {
this.loadedEvent_(data);
} else {
var req = new XMLHttpRequest();
this.loadedEvent_(data);
} else {
var req = new XMLHttpRequest();