From: Robert Konigsberg Date: Mon, 29 Nov 2010 22:12:29 +0000 (-0500) Subject: Missing consistent use of getYRanges(). Fixed zoom.html to use yRanges in API. X-Git-Tag: v1.0.0~584^2~28 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=dea5c743421af0b2299fb7ebd4cf5ee094b831f8;p=dygraphs.git Missing consistent use of getYRanges(). Fixed zoom.html to use yRanges in API. --- diff --git a/dygraph.js b/dygraph.js index ca935a1..0dba534 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1087,7 +1087,7 @@ Dygraph.prototype.doZoomXDates_ = function(minDate, maxDate) { this.drawGraph_(); if (this.attr_("zoomCallback")) { var yRange = this.yAxisRange(); - this.attr_("zoomCallback")(minDate, maxDate, yRange[0], yRange[1]); + this.attr_("zoomCallback")(minDate, maxDate, this.yAxisRanges()); } }; diff --git a/tests/zoom.html b/tests/zoom.html index 121adee..cba823a 100644 --- a/tests/zoom.html +++ b/tests/zoom.html @@ -40,7 +40,8 @@ document.getElementById("div_g"), NoisyData, { errorBars: true, - zoomCallback : function(a,b,c,d) { showDimensions(a,b,c,d); } + zoomCallback : function(minDate, maxDate, yRanges) { + showDimensions(minDate, maxDate, yRanges); } } ); @@ -52,11 +53,11 @@ var maxDate = g.xAxisRange()[1]; var minValue = g.yAxisRange()[0]; var maxValue = g.yAxisRange()[1]; - showDimensions(minDate, maxDate, minValue, maxValue); + showDimensions(minDate, maxDate, [minValue, maxValue]); - function showDimensions(minDate, maxDate, minValue, maxValue) { + function showDimensions(minDate, maxDate, yRanges) { showXDimensions(minDate, maxDate); - showYDimensions(minValue, maxValue); + showYDimensions(yRanges); } function showXDimensions(first, second) { @@ -64,9 +65,9 @@ elem.innerHTML = "dateWindow : [" + first + ", "+ second + "]"; } - function showYDimensions(first, second) { + function showYDimensions(values) { var elem = document.getElementById("ydimensions"); - elem.innerHTML = "valueRange : [" + first + ", "+ second + "]"; + elem.innerHTML = "valueRange : [" + values + "]"; } function zoomGraphX(minDate, maxDate) { @@ -80,7 +81,7 @@ g.updateOptions({ valueRange: [minValue, maxValue] }); - showYDimensions(minValue, maxValue); + showYDimensions(this.getYRanges()); } function unzoomGraph() {