X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=inline;f=tests%2Fzoom.html;h=65f23a4c20325c53213e0a1c5b5356342a940123;hb=b4202b3d4b21a30ed00c6fdfe3d4d39de3034c2b;hp=c3b0e2df8c34c5a5eb52db1332a22c0e8a98348e;hpb=eeab5025da187d3fb284353fd2ba7d69e5d95d39;p=dygraphs.git
diff --git a/tests/zoom.html b/tests/zoom.html
index c3b0e2d..65f23a4 100644
--- a/tests/zoom.html
+++ b/tests/zoom.html
@@ -1,8 +1,10 @@
+
+
zoom
@@ -25,13 +27,17 @@
-
+
-
+
+
+
+
+
@@ -39,7 +45,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 +60,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,23 +72,23 @@
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() {
@@ -88,6 +97,10 @@
valueRange: null
});
}
+
+ function panEdgeFraction(value) {
+ g.updateOptions({ panEdgeFraction : value });
+ }