File: annotation-native.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 (44 lines) | stat: -rw-r--r-- 1,384 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
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Native format annotations</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>This test demonstrates how annotations can be used with <a href="../data.html#array">native-format</a> data.</p>

    <div id="demodiv"></div>

    <script type="text/javascript"><!--//--><![CDATA[//><!--
    Dygraph.onDOMready(function onDOMready() {
      g = new Dygraph(
              document.getElementById("demodiv"),
              [
                [ new Date("2011/11/01"), 100 ],
                [ new Date("2011/11/02"), 200 ],
                [ new Date("2011/11/03"), 300 ],
                [ new Date("2011/11/04"), 100 ],
                [ new Date("2011/11/05"), 200 ],
                [ new Date("2011/11/06"), 300 ],
                [ new Date("2011/11/07"), 200 ],
                [ new Date("2011/11/08"), 100 ]
              ],
              {
                labels: [ 'Date', 'Value' ]
              }
          );

      g.setAnnotations([{
        series: 'Value',
        x: Date.parse('2011/11/04'),
        shortText: 'M',
        text: 'Marker'
      }]);
    });
    //--><!]]></script>
  </body>
</html>