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