From: Robert Konigsberg Date: Thu, 23 Sep 2010 20:56:54 +0000 (-0400) Subject: zoom.html needed a little love. X-Git-Tag: v1.0.0~613^2~23 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=a2db51b539e5a5db661501a10e8925249218cd15;p=dygraphs.git zoom.html needed a little love. --- diff --git a/dygraph.js b/dygraph.js index 2ae8cd9..36986d8 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1058,8 +1058,8 @@ Dygraph.prototype.doUnzoom_ = function() { if (this.attr_("zoomCallback")) { var minDate = this.rawData_[0][0]; var maxDate = this.rawData_[this.rawData_.length - 1][0]; - var minValue = this.xAxisRange()[0]; - var maxValue = this.xAxisRange()[1]; + var minValue = this.yAxisRange()[0]; + var maxValue = this.yAxisRange()[1]; this.attr_("zoomCallback")(minDate, maxDate, minValue, maxValue); } this.drawGraph_(this.rawData_); diff --git a/tests/zoom.html b/tests/zoom.html index 0c21446..c59284a 100644 --- a/tests/zoom.html +++ b/tests/zoom.html @@ -18,11 +18,12 @@

Zoom operations:

-   -   -   -   -   +   +   +   +   +   +  

@@ -54,10 +55,18 @@ function sizeGraph(i) { switch(i) { - case 1: g.doZoomYValues_(4, 2); + case 0: g.doUnzoom_(); + break; + case 1: g.doZoomYValues_(5, 3); + break; + case 2: g.doZoomYValues_(4, 0); + break; + case 3: g.doZoomYValues_(4, 2); + break; + case 4: g.doZoomYValues_(2, 0); + break; + case 5: g.doZoomYValues_(1, 0); break; - case 5: g.doUnzoom_(); - break; } }