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