X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Fis-zoomed.html;fp=tests%2Fis-zoomed.html;h=1b5db9f3bfe81afe67c01beb281b778006a690d4;hb=36dfa9583c9b6134a63654c73aded8710aff2779;hp=50c23f1908632a35c440b24812b88371180e71cc;hpb=d33de6cabb99ea446961ee20da465e5974ebbdf9;p=dygraphs.git diff --git a/tests/is-zoomed.html b/tests/is-zoomed.html index 50c23f1..1b5db9f 100644 --- a/tests/is-zoomed.html +++ b/tests/is-zoomed.html @@ -1,103 +1,104 @@ - - isZoomedIgnoresProgrammaticZoom Flag - - - - - - - - -

Determining Zoom

-

- It is possible to detect whether a chart has been zoomed in either axis by the use of the isZoomed function. - If called with no argument, it will report whether either axis has been zoomed. - Alternatively it can be called with an argument of either 'x' or 'y' and it will report the status of just that axis. -

- -

Here's a simple example using drawCallback to display the various zoom states whenever the chart is zoomed:

- -
OUTPUT
-
-
-

Zoomed: False

-

Zoomed X: False

-

Zoomed Y: False

-

-
-
- -
-
- -

-

HTML
+ + + isZoomedIgnoresProgrammaticZoom Flag + + + + + + + + +

Determining Zoom

+

+ It is possible to detect whether a chart has been zoomed in either axis by the use of the isZoomed function. + If called with no argument, it will report whether either axis has been zoomed. + Alternatively it can be called with an argument of either 'x' or 'y' and it will report the status of just that axis. +

+ +

Here's a simple example using drawCallback to display the various zoom states whenever the chart is zoomed:

+ +
OUTPUT
+
+
+

Zoomed: False

+

Zoomed X: False

+

Zoomed Y: False

+

+
+
+ +
+
+ +

+

HTML
   new Dygraph(
 
-    // containing div
-    document.getElementById("zoomdiv"),
+  // containing div
+  document.getElementById("zoomdiv"),
 
-    // CSV or path to a CSV file.
-    "Date,Temperature\n" +
-    "2011-01-07,75\n" +
-    "2011-01-08,70\n" +
-    "2011-01-09,90\n" +
-    "2011-01-10,30\n" +
-    "2011-01-11,40\n" +
-    "2011-01-12,60\n" +
-    "2011-01-13,70\n" +
-    "2011-01-14,40\n",
-    {
-      drawCallback: function(me, initial) {
-        document.getElementById("zoomed").innerHTML = "" + me.isZoomed();
-        document.getElementById("zoomedX").innerHTML = "" + me.isZoomed("x");
-        document.getElementById("zoomedY").innerHTML = "" + me.isZoomed("y");
-      }
+  // CSV or path to a CSV file.
+  "Date,Temperature\n" +
+  "2011-01-07,75\n" +
+  "2011-01-08,70\n" +
+  "2011-01-09,90\n" +
+  "2011-01-10,30\n" +
+  "2011-01-11,40\n" +
+  "2011-01-12,60\n" +
+  "2011-01-13,70\n" +
+  "2011-01-14,40\n",
+  {
+    drawCallback: function(me, initial) {
+    document.getElementById("zoomed").innerHTML = "" + me.isZoomed();
+    document.getElementById("zoomedX").innerHTML = "" + me.isZoomed("x");
+    document.getElementById("zoomedY").innerHTML = "" + me.isZoomed("y");
     }
+  }
   );
 
-

- -

The Tests for zoom operations show a full example of this in action.

- -

Programmatic Zoom

-

- When a chart is programmatically zoomed by updating either the dateWindow - or valueRange option, by default the zoomed flags are also updated correspondingly. - It is possible to prevent this by specifying the isZoomedIgnoreProgrammaticZoom in the same - call to the updateOptions method. -

-

- The is-zoomed-ignore-programmatic-zoom test shows this in operation. -

- +

+ +

The Tests for zoom operations show a full example of this in action.

+ +

Programmatic Zoom

+

+ When a chart is programmatically zoomed by updating either the dateWindow + or valueRange option, by default the zoomed flags are also updated correspondingly. + It is possible to prevent this by specifying the isZoomedIgnoreProgrammaticZoom in the same + call to the updateOptions method. +

+

+ The is-zoomed-ignore-programmatic-zoom test shows this in operation. +

+