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 #657 from kbaggott/master
[dygraphs.git]
/
src
/
dygraph.js
diff --git
a/src/dygraph.js
b/src/dygraph.js
index
0b42d86
..
a28e231
100644
(file)
--- a/
src/dygraph.js
+++ b/
src/dygraph.js
@@
-1656,10
+1656,11
@@
Dygraph.prototype.resetZoom = function() {
this.zoomed_x_ = false;
this.zoomed_y_ = false;
this.zoomed_x_ = false;
this.zoomed_y_ = false;
- var minDate = this.rawData_[0][0];
- var maxDate = this.rawData_[this.rawData_.length - 1][0];
+ //calculate extremes to avoid lack of padding on reset.
+ var extremes = this.xAxisExtremes();
+ var minDate = extremes[0],
+ maxDate = extremes[1];
- // With only one frame, don't bother calculating extreme ranges.
// TODO(danvk): merge this block w/ the code below.
if (!this.getBooleanOption("animatedZooms")) {
this.dateWindow_ = null;
// TODO(danvk): merge this block w/ the code below.
if (!this.getBooleanOption("animatedZooms")) {
this.dateWindow_ = null;