X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=docs%2Findex.html;h=9e652b5e1dcc2cc290fd51e786631258c0bcbf77;hb=dcb25130b93f7d1ca126c01fb90f1b1aa413c54d;hp=b9eff5433f3653d0e82312a4e29a2067b9c6e1e5;hpb=62ac7bd0768c8899e2561ebbbe23f33ad4d59568;p=dygraphs.git diff --git a/docs/index.html b/docs/index.html index b9eff54..9e652b5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -34,6 +34,7 @@
  • Source
  • Issues
  • Report Bug
  • +
  • Contribute a change
  • Contact
  • @@ -69,6 +70,7 @@
  • Multiple Series
  • Custom Underlay / background
  • Tests for zoom operations
  • +
  • Log scale tests
  • @@ -446,6 +448,96 @@ new Dygraph(el, data, {
  • Where the error bars do not overlap, we can say with 95% confidence that the series differ. There is a better than 95% chance that Ichiro was a better hitter than his team as a whole in 2004, the year he won the batting title.
  • +

    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"),
    +
    +    // 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 noZoomFlagChange in the same + call to the updateOptions method. +

    +

    + The no-zoom-change test shows this in operation. +

    +

    One last demo

    This chart shows monthly closes of the Dow Jones Industrial Average, both in nominal and real (i.e. adjusted for inflation) dollars. The shaded areas show its monthly high and low. CPI values with a base from 1982-84 are used to adjust for inflation.

    @@ -655,6 +747,13 @@ perl -ne 'BEGIN{print "Month,Nominal,Real\n"} chomp; ($m,$cpi,$low,$close,$high) + + Changing either of two the above options will cause the corresponding zoom + flag (isZoomed()) to be set, unless the noZoomFlagChange + option is also specified. + + + labelsSeparateLines boolean false @@ -729,7 +828,7 @@ perl -ne 'BEGIN{print "Month,Nominal,Real\n"} chomp; ($m,$cpi,$low,$close,$high) pointSize - interger + integer 1 The size of the dot to draw on each point in pixels (see drawPoints). A dot is always drawn when a point is "isolated", i.e. there is a missing point on either side of it. This also controls the size of those dots.
    Tests: none
    @@ -945,6 +1044,31 @@ perl -ne 'BEGIN{print "Month,Nominal,Real\n"} chomp; ($m,$cpi,$low,$close,$high) + + logscale + boolean + false + + When set for a y-axis, the graph shows that axis in y-scale. Any values less than or equal + to zero are not displayed.

    + + Not compatible with showZero, and ignores connectSeparatedPoints. Also, showing log scale + with valueRanges that are less than zero will result in an unviewable graph.
    + +
    Tests: logscale, + stock
    + + + + + noZoomFlagChange + + + + When this flag is passed 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. +
    Tests: no-zoom-change
    +