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