Commit | Line | Data |
---|---|---|
54425b14 | 1 | <!DOCTYPE html> |
bf0e5ca5 DV |
2 | <html> |
3 | <head> | |
fd6b8dad | 4 | <link rel="stylesheet" href="../dist/dygraph.css"> |
937029df | 5 | <title>visibility</title> |
fbd6834a | 6 | <script type="text/javascript" src="../dist/dygraph.js"></script> |
7e5ddc94 | 7 | |
bf0e5ca5 DV |
8 | <script type="text/javascript" src="data.js"></script> |
9 | </head> | |
10 | <body> | |
11 | <h3>Click the check boxes to toggle series visibility</h3> | |
12 | <div id="div_g" style="width:600px; height:300px;"></div> | |
13 | ||
14 | <p><b>Show Series:</b></p> | |
15 | <p> | |
16 | <input type=checkbox id="0" onClick="change(this)"> | |
17 | <label for="0"> A</label><br/> | |
18 | <input type=checkbox id="1" checked onClick="change(this)"> | |
ddb40267 RK |
19 | <label for="1"> B</label><br/> |
20 | <input type=checkbox id="2" checked onClick="change(this)"> | |
21 | <label for="2"> C</label> | |
bf0e5ca5 DV |
22 | </p> |
23 | ||
24 | <p>g.visibility() = <span id="visibility"></span></p> | |
25 | ||
26 | ||
27 | <script type="text/javascript"> | |
28 | g = new Dygraph( | |
29 | document.getElementById("div_g"), | |
ddb40267 | 30 | NoisyDataABC, { |
bf0e5ca5 DV |
31 | rollPeriod: 7, |
32 | errorBars: true, | |
ddb40267 | 33 | visibility: [false, true, true] |
bf0e5ca5 DV |
34 | } |
35 | ); | |
36 | setStatus(); | |
37 | ||
38 | function setStatus() { | |
39 | document.getElementById("visibility").innerHTML = | |
40 | g.visibility().toString(); | |
41 | } | |
42 | ||
43 | function change(el) { | |
44 | g.setVisibility(parseInt(el.id), el.checked); | |
45 | setStatus(); | |
46 | } | |
47 | </script> | |
48 | ||
49 | </body> | |
50 | </html> |