Commit | Line | Data |
---|---|---|
c1f22b5a RK |
1 | Gallery.register( |
2 | 'color-visibility', | |
3 | { | |
4 | name: "Color visibility", | |
5 | title: 'The lines should maintain their colors as their visibility is toggled.', | |
6 | setup: function(parent) { | |
7 | parent.innerHTML = | |
8 | "<div id='blah'></div>" + | |
9 | "<p><b>Display: </b>" + | |
10 | "<input type=checkbox id=0 onClick='change(this)' checked>" + | |
11 | "<label for='0'> a</label>" + | |
12 | "<input type=checkbox id=1 onClick='change(this)' checked>" + | |
13 | "<label for='1'> b</label>" + | |
14 | "<input type=checkbox id=2 onClick='change(this)' checked>" + | |
15 | "<label for='2'> c</label>" + | |
16 | "</p>"; | |
17 | }, | |
18 | run: function() { | |
19 | var g = new Dygraph(document.getElementById("blah"), | |
20 | "X,a,b,c\n" + | |
21 | "10,12345,23456,34567\n" + | |
22 | "11,12345,20123,31345\n", | |
23 | { | |
24 | width: 640, | |
25 | height: 480, | |
26 | colors: ['#284785', '#EE1111', '#8AE234'], | |
27 | visibility: [true, true, true] | |
28 | }); | |
29 | ||
30 | function change(el) { | |
31 | g.setVisibility(el.id, el.checked); | |
32 | } | |
33 | } | |
34 | }); |