X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=inline;f=tests%2Fzoom.html;h=ad0bc9da10bd516e94c30bbfc88bab68998b7abe;hb=a96f59f41a1ea59d07173e4daa09305673f40d0d;hp=353be3bbc1b3a5ecc8c0905ded22f841a536941e;hpb=c65f2303664330f03787d4e0bc7da5f2d9b4bc5f;p=dygraphs.git
diff --git a/tests/zoom.html b/tests/zoom.html
index 353be3b..ad0bc9d 100644
--- a/tests/zoom.html
+++ b/tests/zoom.html
@@ -2,7 +2,7 @@
zoom
@@ -39,7 +39,10 @@
g = new Dygraph(
document.getElementById("div_g"),
NoisyData, {
- zoomCallback : function(a,b,c,d) { showDimensions(a,b,c,d); }
+ errorBars: true,
+ zoomCallback : function(minDate, maxDate, yRanges) {
+ showDimensions(minDate, maxDate, yRanges);
+ }
}
);
@@ -51,11 +54,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) {
- showXDimensions(minDate, maxDate);
- showYDimensions(minValue, maxValue);
+ function showDimensions(minDate, maxDate, yRanges) {
+ showXDimensions(minDate, maxDate);
+ showYDimensions(yRanges);
}
function showXDimensions(first, second) {
@@ -63,29 +66,29 @@
elem.innerHTML = "dateWindow : [" + first + ", "+ second + "]";
}
- function showYDimensions(first, second) {
+ function showYDimensions(ranges) {
var elem = document.getElementById("ydimensions");
- elem.innerHTML = "valueRange : [" + first + ", "+ second + "]";
+ elem.innerHTML = "valueRange : [" + ranges + "]";
}
function zoomGraphX(minDate, maxDate) {
g.updateOptions({
dateWindow: [minDate, maxDate]
});
- showXDimensions(minDate, maxDate);
+ showXDimensions(minDate, maxDate);
}
function zoomGraphY(minValue, maxValue) {
g.updateOptions({
valueRange: [minValue, maxValue]
});
- showYDimensions(minValue, maxValue);
+ showYDimensions(g.yAxisRanges());
}
function unzoomGraph() {
g.updateOptions({
- dateWindow: undefined,
- valueRange: undefined
+ dateWindow: null,
+ valueRange: null
});
}