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