| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9"> |
| 5 | <title>demo</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 | <style> |
| 11 | /* Changing 'body' -> 'html, body' triggers a bug */ |
| 12 | body { |
| 13 | margin-left: 100px; |
| 14 | } |
| 15 | |
| 16 | .container { |
| 17 | text-align: center; |
| 18 | } |
| 19 | </style> |
| 20 | </head> |
| 21 | <body> |
| 22 | <p>Mouseovers should work as expected (dots should align with mouse)</p> |
| 23 | <div id="demodiv"></div> |
| 24 | |
| 25 | <script type="text/javascript"> |
| 26 | function Data() { |
| 27 | var zp = function(x) { if (x < 10) return "0"+x; else return x; }; |
| 28 | var r = "date,parabola,line,another line,sine wave\n"; |
| 29 | for (var i=1; i<=31; i++) { |
| 30 | r += "200610" + zp(i); |
| 31 | r += "," + 10*(i*(31-i)); |
| 32 | r += "," + 10*(8*i); |
| 33 | r += "," + 10*(250 - 8*i); |
| 34 | r += "," + 10*(125 + 125 * Math.sin(0.3*i)); |
| 35 | r += "\n"; |
| 36 | } |
| 37 | return r; |
| 38 | } |
| 39 | |
| 40 | g = new Dygraph( |
| 41 | document.getElementById("demodiv"), |
| 42 | Data, |
| 43 | { |
| 44 | labelsKMB: true, |
| 45 | legend: 'always' |
| 46 | } |
| 47 | ); |
| 48 | </script> |
| 49 | |
| 50 | <br/> |
| 51 | <div class="container"> |
| 52 | <div id="chart2"></div> |
| 53 | </div> |
| 54 | |
| 55 | <script type="text/javascript"> |
| 56 | g = new Dygraph( |
| 57 | document.getElementById("chart2"), |
| 58 | Data, |
| 59 | { |
| 60 | labelsKMB: true, |
| 61 | legend: 'always' |
| 62 | } |
| 63 | ); |
| 64 | </script> |
| 65 | </body> |
| 66 | </html> |