Commit | Line | Data |
---|---|---|
54425b14 | 1 | <!DOCTYPE html> |
ec1959eb DV |
2 | <html> |
3 | <head> | |
fd6b8dad | 4 | <link rel="stylesheet" href="../dist/dygraph.css"> |
ec1959eb | 5 | <title>color visibility</title> |
fbd6834a | 6 | <script type="text/javascript" src="../dist/dygraph.js"></script> |
7e5ddc94 | 7 | |
ec1959eb DV |
8 | </head> |
9 | <body> | |
10 | <p>The lines should maintain their colors as their visibility is toggled.</p> | |
11 | ||
12 | <div id="blah"></div> | |
13 | <p><b>Display: </b> | |
14 | <input type=checkbox id=0 onClick="change(this)" checked> | |
15 | <label for="0"> a</label> | |
16 | <input type=checkbox id=1 onClick="change(this)" checked> | |
17 | <label for="1"> b</label> | |
18 | <input type=checkbox id=2 onClick="change(this)" checked> | |
19 | <label for="2"> c</label> | |
20 | </p> | |
21 | ||
22 | <script type="text/javascript"> | |
23 | chart = new Dygraph(document.getElementById("blah"), | |
24 | "X,a,b,c\n" + | |
25 | "10,12345,23456,34567\n" + | |
26 | "11,12345,20123,31345\n", | |
27 | { | |
28 | width: 640, | |
29 | height: 480, | |
30 | colors: ['#284785', '#EE1111', '#8AE234'], | |
31 | visibility: [true, true, true] | |
32 | }); | |
33 | ||
34 | function change(el) { | |
35 | chart.setVisibility(el.id, el.checked); | |
36 | } | |
37 | </script> | |
38 | </body> | |
39 | </html> |