File: label-div.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 (66 lines) | stat: -rw-r--r-- 2,533 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
63
64
65
66
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>label-div</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>
    <script type="text/javascript" src="data.js"></script>
  </head>
  <body>
    <p>Chart with labels displayed in a separate div:</p>
    <table><tr>
    <td valign="top"><div id="graphdiv2"></div></td>
    <td valign="top">   </td>
    <td valign="top"><div id="labels"></div></td>
    </tr></table>
    <p>
        The following chart should be the same as above. Here we use the
        labelsDiv id instead of the actual labelsDiv element.<br />This is
        useful when the labelsDiv element has not been attached to the
        DOM when the chart/options is created:
    </p>
    <table><tr>
    <td valign="top"><div id="graphdiv3"></div></td>
    <td valign="top">   </td>
    <td valign="top"><div id="labels2"></div></td>
    </tr></table>
    <p>
        The following chart shows the labelsShowZeroValues option in use.
        When any point has a zero value the label is not shown.  This is
        useful when there are many zero values in a point and the user
        is only interested in the non-zero points.
    </p>
    <table><tr>
    <td valign="top"><div id="graphdiv4"></div></td>
    <td valign="top">   </td>
    <td valign="top"><div id="labels3"></div></td>
    </tr></table>

    <script type="text/javascript"><!--//--><![CDATA[//><!--
    Dygraph.onDOMready(function onDOMready() {
      g2 = new Dygraph(document.getElementById("graphdiv2"),
                       data_nolabel,
                       {
                         labels: [ "Date", "High", "Low" ],
                         labelsDiv: document.getElementById("labels")
                       });
      g3 = new Dygraph(document.getElementById("graphdiv3"),
                       data_nolabel,
                       {
                         labels: [ "Date", "High", "Low" ],
                         labelsDiv: "labels2"
                       });
      g4 = new Dygraph(document.getElementById("graphdiv4"),
                       data_showzerovalues,
                       {
                         labels: [ "Date", "High", "Low" ],
                         labelsDiv: "labels3",
                         labelsShowZeroValues: false
                       });
    });
    //--><!]]></script>
  </body>
</html>