X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fzoom.html;h=a835dc379102c2e24d3c5365e3fedfc4a5b37c47;hb=77b5e09d8097138dfd4871db7a1240c787b916af;hp=8c9e64141ea6934f2c0e1a299f7f195ec1066275;hpb=37567cceaeaee48596653c1b59adb12fca8dbc26;p=dygraphs.git
diff --git a/tests/zoom.html b/tests/zoom.html
index 8c9e641..a835dc3 100644
--- a/tests/zoom.html
+++ b/tests/zoom.html
@@ -1,13 +1,17 @@
+
+
zoom
-
-
-
-
+
+
+
@@ -31,13 +35,17 @@
-
+
-
+
+
+
+
+
@@ -46,13 +54,13 @@
document.getElementById("div_g"),
NoisyData, {
errorBars: true,
- zoomCallback : function(a,b,c,d) {
- showDimensions(a,b,c,d);
+ zoomCallback : function(minDate, maxDate, yRange) {
+ showDimensions(minDate, maxDate, yRange);
},
drawCallback: function(me, initial) {
- document.getElementById("zoomed").innerHTML = me.zoomed ? "True" : "False";
- document.getElementById("zoomedX").innerHTML = me.zoomedX ? "True" : "False";
- document.getElementById("zoomedY").innerHTML = me.zoomedY ? "True" : "False";
+ document.getElementById("zoomed").innerHTML = "" + me.isZoomed();
+ document.getElementById("zoomedX").innerHTML = "" + me.isZoomed("x");
+ document.getElementById("zoomedY").innerHTML = "" + me.isZoomed("y");
}
}
);
@@ -65,11 +73,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) {
@@ -77,23 +85,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() {
@@ -102,6 +110,10 @@
valueRange: null
});
}
+
+ function panEdgeFraction(value) {
+ g.updateOptions({ panEdgeFraction : value });
+ }