Commit | Line | Data |
---|---|---|
d9fbba56 RK |
1 | <!DOCTYPE html> |
2 | <html> | |
3 | <head> | |
93a5bb4c | 4 | <link rel="stylesheet" href="../css/dygraph.css"> |
d9fbba56 | 5 | <title>plugins demo</title> |
fbd6834a | 6 | <script type="text/javascript" src="../dist/dygraph.js"></script> |
d9fbba56 RK |
7 | |
8 | <!-- Include the Javascript for the plug-in --> | |
2b66af4f | 9 | <script type="text/javascript" src="../src/extras/unzoom.js"></script> |
d9fbba56 RK |
10 | </head> |
11 | <body> | |
12 | <h2>Plugins Demo</h2> | |
13 | <table><tr><td> | |
14 | <div id="demodiv"></div> | |
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"> | |
20 | g = new Dygraph( | |
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 | }, | |
35 | { | |
36 | labelsDiv: document.getElementById('status'), | |
37 | labelsSeparateLines: true, | |
38 | labelsKMB: true, | |
39 | legend: 'always', | |
40 | colors: ["rgb(51,204,204)", | |
41 | "rgb(255,100,100)", | |
42 | "#00DD55", | |
43 | "rgba(50,50,200,0.4)"], | |
44 | width: 640, | |
45 | height: 480, | |
46 | title: 'Interesting Shapes', | |
47 | xlabel: 'Date', | |
48 | ylabel: 'Count', | |
49 | axisLineColor: 'white', | |
50 | ||
51 | // Set the plug-ins in the options. | |
52 | plugins : [ | |
53 | Dygraph.Plugins.Unzoom | |
54 | ] | |
55 | } | |
56 | ); | |
57 | </script> | |
58 | </body> | |
59 | </html> |