Set this for drawCallback
[dygraphs.git] / tests / demo.html
CommitLineData
54425b14 1<!DOCTYPE html>
285a6bda
DV
2<html>
3 <head>
6f091595 4 <title>demo</title>
74a5af31 5 <script type="text/javascript" src="../dygraph-dev.js"></script>
285a6bda
DV
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>
c21d2c2d 11 <div id="demodiv"></div>
285a6bda
DV
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">
00259bf3 17 g = new Dygraph(
285a6bda
DV
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 },
285a6bda 32 {
285a6bda
DV
33 labelsDiv: document.getElementById('status'),
34 labelsSeparateLines: true,
35 labelsKMB: true,
74a5af31 36 legend: 'always',
551aa865 37 colors: ["rgb(51,204,204)",
285a6bda
DV
38 "rgb(255,100,100)",
39 "#00DD55",
40 "rgba(50,50,200,0.4)"],
ad1798c2
DV
41 width: 640,
42 height: 480,
43 title: 'Interesting Shapes',
44 xlabel: 'Date',
74a5af31 45 ylabel: 'Count',
0604287e 46 axisLineColor: 'white'
189f8030 47 // drawXGrid: false
285a6bda
DV
48 }
49 );
50 </script>
51</body>
52</html>