Ooh more code cleanup; all 155 tests pass.
[dygraphs.git] / tests / demo.html
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 </head>
11 <body>
12 <h2>Demo</h2>
13 <font size=-1>(Mouse over to highlight individual values. Click and drag to zoom. Double-click to zoom out.)</font><br/>
14 <table><tr><td>
15 <div id="demodiv"></div>
16 </td><td valign=top>
17 <div id="status" style="width:200px; font-size:0.8em; padding-top:5px;"></div>
18 </td>
19 </tr></table>
20 <script type="text/javascript">
21 g = new Dygraph(
22 document.getElementById("demodiv"),
23 function() {
24 var zp = function(x) { if (x < 10) return "0"+x; else return x; };
25 var r = "date,parabola,line,another line,sine wave\n";
26 for (var i=1; i<=31; i++) {
27 r += "200610" + zp(i);
28 r += "," + 10*(i*(31-i));
29 r += "," + 10*(8*i);
30 r += "," + 10*(250 - 8*i);
31 r += "," + 10*(125 + 125 * Math.sin(0.3*i));
32 r += "\n";
33 }
34 return r;
35 },
36 {
37 labelsDiv: document.getElementById('status'),
38 labelsSeparateLines: true,
39 labelsKMB: true,
40 legend: 'always',
41 colors: ["rgb(51,204,204)",
42 "rgb(255,100,100)",
43 "#00DD55",
44 "rgba(50,50,200,0.4)"],
45 width: 640,
46 height: 480,
47 title: 'Interesting Shapes',
48 xlabel: 'Date',
49 ylabel: 'Count',
50 axisLineColor: 'white'
51 // drawXGrid: false
52 }
53 );
54 </script>
55 </body>
56 </html>