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