From 1f6a6254deed20c2c25108bf6d98a298898ba34a Mon Sep 17 00:00:00 2001 From: Uemit Seren Date: Thu, 16 Feb 2012 11:07:26 +0100 Subject: [PATCH] Bugfix #282. Use valueRange (if specified) instead of extremes during unzooming. Fixed the check whether the y-axis is dirty --- dygraph.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dygraph.js b/dygraph.js index 758d26d..18dea9e 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1332,7 +1332,7 @@ Dygraph.prototype.doUnzoom_ = function() { } for (var i = 0; i < this.axes_.length; i++) { - if (this.axes_[i].valueWindow !== null) { + if (typeof(this.axes_[i].valueWindow) !== 'undefined' && this.axes_[i].valueWindow !== null) { dirty = true; dirtyY = true; } @@ -1384,7 +1384,8 @@ Dygraph.prototype.doUnzoom_ = function() { newValueRanges = []; for (i = 0; i < this.axes_.length; i++) { - newValueRanges.push(this.axes_[i].extremeRange); + var axis = this.axes_[i]; + newValueRanges.push(axis.valueRange != null ? axis.valueRange : axis.extremeRange); } } -- 2.7.4