4e4538d87200b1130eec1c76f90d06005ee997da
[dygraphs.git] / tests / annotation-native.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <link rel="stylesheet" href="../css/dygraph.css">
5 <title>Native format annotations</title>
6 <script type="text/javascript" src="../dist/dygraph.js"></script>
7 </head>
8 <body>
9 <p>This test demonstrates how annotations can be used with <a href="http://dygraphs.com/data.html#array">native-format</a> data.</p>
10
11 <div id="demodiv"></div>
12
13 <script type="text/javascript">
14 g = new Dygraph(
15 document.getElementById("demodiv"),
16 [
17 [ new Date("2011/11/01"), 100 ],
18 [ new Date("2011/11/02"), 200 ],
19 [ new Date("2011/11/03"), 300 ],
20 [ new Date("2011/11/04"), 100 ],
21 [ new Date("2011/11/05"), 200 ],
22 [ new Date("2011/11/06"), 300 ],
23 [ new Date("2011/11/07"), 200 ],
24 [ new Date("2011/11/08"), 100 ]
25 ],
26 {
27 labels: [ 'Date', 'Value' ]
28 }
29 );
30
31 g.setAnnotations([{
32 series: 'Value',
33 x: Date.parse('2011/11/04'),
34 shortText: 'M',
35 text: 'Marker'
36 }]);
37 </script>
38 </body>
39 </html>