From a2db51b539e5a5db661501a10e8925249218cd15 Mon Sep 17 00:00:00 2001 From: Robert Konigsberg Date: Thu, 23 Sep 2010 16:56:54 -0400 Subject: [PATCH 1/1] zoom.html needed a little love. --- dygraph.js | 4 ++-- tests/zoom.html | 25 +++++++++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) 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; } } -- 2.7.4