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