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