From 36dfa9583c9b6134a63654c73aded8710aff2779 Mon Sep 17 00:00:00 2001
From: Dan Vanderkam
- By default, when the
+ By default, when the
+ Sometimes it may be desirable to change the display of the chart by
+ manipulating the
+ In this case
+ The chart below may be manipulated to change the
+ Toggle the check box below to determine the difference in operation of the zoom flags
+ when the date and value windows of the chart are changed using the arrows underneath.
+ Do not change zoom flags (
- Sometimes it may be desirable to change the display of the chart by
- manipulating the
- In this case
- The chart below may be manipulated to change the
- Toggle the check box below to determine the difference in operation of the zoom flags
- when the date and value windows of the chart are changed using the arrows underneath.
+ Max X Axis:
+
+
Do not change zoom flags (
- Max Y Axis:
-
-
-
- Min Y Axis:
-
-
-
- Min X Axis:
-
-
-
- Max X Axis:
-
-
- Zoomed: False Zoomed X: False Zoomed Y: False Zoomed: False Zoomed X: False Zoomed Y: False
- It is possible to detect whether a chart has been zoomed in either axis by the use of the Here's a simple example using Zoomed: False Zoomed X: False Zoomed Y: False
-
+ It is possible to detect whether a chart has been zoomed in either axis by the use of the Here's a simple example using Zoomed: False Zoomed X: False Zoomed Y: False
+ dateWindow
or valueRange
options, the zoom flags are not changed to reflect a zoomed state. This is primarily useful for when the display area of a chart is changed programmatically and also where manual zooming is allowed and use is made of the isZoomed
method to determine this."
+ "description" : "When this option is passed to updateOptions() along with either the dateWindow
or valueRange
options, the zoom flags are not changed to reflect a zoomed state. This is primarily useful for when the display area of a chart is changed programmatically and also where manual zooming is allowed and use is made of the isZoomed
method to determine this."
}
}
; // isZoomedIgnoreProgrammaticZoom Option
- dateWindow
or updateOptions
- of a chart is changed programmatically by a call to updateOptions
- the zoomed flags (isZoomed
) are changed. This is the same
- as manually zooming in using the mouse.
- isZoomedIgnoreProgrammaticZoom Option
+ dateWindow
or updateOptions
+ of a chart is changed programmatically by a call to updateOptions
+ the zoomed flags (isZoomed
) are changed. This is the same
+ as manually zooming in using the mouse.
+ dateWindow
and valueRange
+ options but without changing the zoomed flags, for example where manual
+ zooming is still required but where it is also desired that the zoomed
+ flags drive display elements, but only for manual zooming.
+ isZoomedIgnoreProgrammaticZoom
may be specified along with
+ either the dateWindow
or valueRange
values to
+ updateOptions
and the zoomed flags will remain unaffected.
+ updateOptions
+ using the Max and Min Y axis buttons and the dateWindow
+ by using the Max and Min X axis buttons.
+ isZoomedIgnoreProgrammaticZoom
)dateWindow
and valueRange
- options but without changing the zoomed flags, for example where manual
- zooming is still required but where it is also desired that the zoomed
- flags drive display elements, but only for manual zooming.
+ Max Y Axis:
+
+
isZoomedIgnoreProgrammaticZoom
may be specified along with
- either the dateWindow
or valueRange
values to
- updateOptions
and the zoomed flags will remain unaffected.
+ Min Y Axis:
+
+
updateOptions
- using the Max and Min Y axis buttons and the dateWindow
- by using the Max and Min X axis buttons.
+ Min X Axis:
+
+
isZoomedIgnoreProgrammaticZoom
) Zoomed Flags
- Window coordinates (in dates and values):
-
-
- Zoomed Flags
+ Window coordinates (in dates and values):
+
+
+ Determining Zoom
- 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.
- drawCallback
to display the various zoom states whenever the chart is zoomed:Determining Zoom
+ 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.
+ drawCallback
to display the various zoom states whenever the chart is zoomed:
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.
- -
- 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.
+ +
+ 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. +
+ -- 2.7.4