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