Add auto test for isolated and gap points.
[dygraphs.git] / tests / logscale.html
CommitLineData
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]-->
7e5ddc94
DV
9 <!--
10 For production (minified) code, use:
11 <script type="text/javascript" src="dygraph-combined.js"></script>
12 -->
13 <script type="text/javascript" src="../dygraph-dev.js"></script>
14
ff022deb
RK
15 </head>
16
17 <body>
2cae510b
RK
18 <center>
19 <input id='log' type="button" value="log scale" onclick="setLogScale(true)">
20 <input id='linear' type="button" value="linear scale" onclick="setLogScale(false)">
21 </center>
22
93f26a2d 23 <h2>X axis of dates</h2>
2cae510b
RK
24 <div id="div_g0" style="width:600px; height:300px;"></div>
25
93f26a2d 26 <h2>X axis of numbers</h2>
2cae510b
RK
27 <div id="div_g1" style="width:600px; height:300px;"></div>
28
ff022deb 29 <script type="text/javascript">
2cae510b 30 function data0() {
ff022deb 31 return "Date,A\n" +
d59b6f34
RK
32 "20101201,5\n"+
33 "20101202,10\n"+
2cae510b 34 "20101203,-1\n"+
d59b6f34
RK
35 "20101204,250\n"+
36 "20101205,1000\n"+
37 "20101206,30\n"+
38 "20101207,80\n"+
39 "20101208,100\n"+
7d0e7a0d 40 "20101209,500\n"+
ff022deb 41 "";
2cae510b
RK
42 };
43 function data1() {
7d0e7a0d 44 return "X,A\n" +
4b467120 45 "1,0.000001\n"+
7d0e7a0d
RK
46 "2,10\n"+
47 "3,100\n"+
48 "4,250\n"+
49 "5,1000\n"+
50 "6,30\n"+
9d8685cc 51 "7,0\n"+
7d0e7a0d
RK
52 "8,100\n"+
53 "9,500\n"+
44462ba3 54 "101,500\n"+
7d0e7a0d 55 "";
2cae510b 56 };
ff022deb 57
2cae510b 58 var g0 = new Dygraph(document.getElementById("div_g0"),
315d4876
RK
59 data0, { logscale : true });
60 var g1 = new Dygraph(document.getElementById("div_g1"),
61 data1, { logscale : true });
2cae510b
RK
62 function setLogScale(val) {
63 g0.updateOptions({ logscale: val });
315d4876 64 g1.updateOptions({ logscale: val });
2cae510b
RK
65 document.getElementById("linear").disabled = !val;
66 document.getElementById("log").disabled = val;
ff022deb
RK
67 }
68 </script>
69
70 </body>
71</html>