Commit | Line | Data |
---|---|---|
ff022deb RK |
1 | <html> |
2 | <head> | |
3 | <title>log scale</title> | |
4 | <!--[if IE]> | |
5 | <script type="text/javascript" src="../excanvas.js"></script> | |
6 | <![endif]--> | |
7 | <script type="text/javascript" src="../strftime/strftime-min.js"></script> | |
8 | <script type="text/javascript" src="../rgbcolor/rgbcolor.js"></script> | |
9 | <script type="text/javascript" src="../dygraph-canvas.js"></script> | |
10 | <script type="text/javascript" src="../dygraph.js"></script> | |
11 | </head> | |
12 | ||
13 | <body> | |
2cae510b RK |
14 | <center> |
15 | <input id='log' type="button" value="log scale" onclick="setLogScale(true)"> | |
16 | <input id='linear' type="button" value="linear scale" onclick="setLogScale(false)"> | |
17 | </center> | |
18 | ||
93f26a2d | 19 | <h2>X axis of dates</h2> |
2cae510b RK |
20 | <div id="div_g0" style="width:600px; height:300px;"></div> |
21 | ||
93f26a2d | 22 | <h2>X axis of numbers</h2> |
2cae510b RK |
23 | <div id="div_g1" style="width:600px; height:300px;"></div> |
24 | ||
ff022deb | 25 | <script type="text/javascript"> |
2cae510b | 26 | function data0() { |
ff022deb | 27 | return "Date,A\n" + |
d59b6f34 RK |
28 | "20101201,5\n"+ |
29 | "20101202,10\n"+ | |
2cae510b | 30 | "20101203,-1\n"+ |
d59b6f34 RK |
31 | "20101204,250\n"+ |
32 | "20101205,1000\n"+ | |
33 | "20101206,30\n"+ | |
34 | "20101207,80\n"+ | |
35 | "20101208,100\n"+ | |
7d0e7a0d | 36 | "20101209,500\n"+ |
ff022deb | 37 | ""; |
2cae510b RK |
38 | }; |
39 | function data1() { | |
7d0e7a0d | 40 | return "X,A\n" + |
4b467120 | 41 | "1,0.000001\n"+ |
7d0e7a0d RK |
42 | "2,10\n"+ |
43 | "3,100\n"+ | |
44 | "4,250\n"+ | |
45 | "5,1000\n"+ | |
46 | "6,30\n"+ | |
47 | "7,80\n"+ | |
48 | "8,100\n"+ | |
49 | "9,500\n"+ | |
50 | ""; | |
2cae510b | 51 | }; |
ff022deb | 52 | |
2cae510b | 53 | var g0 = new Dygraph(document.getElementById("div_g0"), |
315d4876 RK |
54 | data0, { logscale : true }); |
55 | var g1 = new Dygraph(document.getElementById("div_g1"), | |
56 | data1, { logscale : true }); | |
2cae510b RK |
57 | function setLogScale(val) { |
58 | g0.updateOptions({ logscale: val }); | |
315d4876 | 59 | g1.updateOptions({ logscale: val }); |
2cae510b RK |
60 | document.getElementById("linear").disabled = !val; |
61 | document.getElementById("log").disabled = val; | |
ff022deb RK |
62 | } |
63 | </script> | |
64 | ||
65 | </body> | |
66 | </html> |