File: small-range-zero.html

package info (click to toggle)
dygraphs 2.2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,340 kB
  • sloc: javascript: 24,842; sh: 800; python: 581; makefile: 45
file content (62 lines) | stat: -rw-r--r-- 2,021 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>no range</title>

    <link rel="stylesheet" type="text/css" href="../dist/dygraph.css" />
    <link rel="stylesheet" type="text/css" href="../common/vextlnk.css" />
    <script type="text/javascript" src="../dist/dygraph.js"></script>
  </head>
  <body>
    <p>There should be an appropriate amount of padding at the top of the chart:</p>
    <div id="blah"></div>

    <script type="text/javascript"><!--//--><![CDATA[//><!--
    Dygraph.onDOMready(function onDOMready() {
    function CSV() {
      var label = "X";

      return "date," + label + "\n20091206,2659329.631743\n20091213,2772361.123362\n20091220,2737584.647191\n20091227,2720000.550414\n20100103,2910306.897977\n20100110,2901385.313093\n20100117,2903041.312099\n20100124,2966455.128911\n";
    }

    g1 = new Dygraph(document.getElementById("blah"),
                CSV,
                {
                  width: 640,
                  height: 480,
                  includeZero: true
                });

    });
    //--><!]]></script>

    <p>The second series (which is entirely zero) should be visible, and the
    y-axis should go down to zero.</p>
    <div id="blah2"></div>
    <script type="text/javascript"><!--//--><![CDATA[//><!--
    Dygraph.onDOMready(function onDOMready() {
        var data=[
          ["2006-10-11",0,15228],
          ["2006-10-12",0,15219],
          ["2006-10-13",0,15225],
          ["2006-10-14",0,15212],
          ["2006-10-15",0,15211],
          ["2006-10-16",0,15322],
          ["2006-10-17",0,15414],
          ["2006-10-18",0,15422],
          ["2006-10-19",0,15434],
          ["2006-10-20",0,15423]
        ];
        var str = "";
        for (var i = 0; i < data.length; i++) {
          str += data[i].join(",") + "\n";
        }

        g2 = new Dygraph(document.getElementById("blah2"),
                    str,
                    { labels: [ "date", "zero", "non-zero" ] });
    });
    //--><!]]></script>
  </body>
</html>