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