Merge branch 'master' of https://github.com/kberg/dygraphs
[dygraphs.git] / tests / color-visibility.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
5 <title>color visibility</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 <body>
15 <p>The lines should maintain their colors as their visibility is toggled.</p>
16
17 <div id="blah"></div>
18 <p><b>Display: </b>
19 <input type=checkbox id=0 onClick="change(this)" checked>
20 <label for="0"> a</label>
21 <input type=checkbox id=1 onClick="change(this)" checked>
22 <label for="1"> b</label>
23 <input type=checkbox id=2 onClick="change(this)" checked>
24 <label for="2"> c</label>
25 </p>
26
27 <script type="text/javascript">
28 chart = new Dygraph(document.getElementById("blah"),
29 "X,a,b,c\n" +
30 "10,12345,23456,34567\n" +
31 "11,12345,20123,31345\n",
32 {
33 width: 640,
34 height: 480,
35 colors: ['#284785', '#EE1111', '#8AE234'],
36 visibility: [true, true, true]
37 });
38
39 function change(el) {
40 chart.setVisibility(el.id, el.checked);
41 }
42 </script>
43 </body>
44 </html>