Hiding "copy".
[dygraphs.git] / tests / visibility.html
CommitLineData
54425b14 1<!DOCTYPE html>
bf0e5ca5
DV
2<html>
3 <head>
10494b48 4 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
937029df 5 <title>visibility</title>
bf0e5ca5 6 <!--[if IE]>
a2b2c3a1 7 <script type="text/javascript" src="../excanvas.js"></script>
bf0e5ca5 8 <![endif]-->
7e5ddc94
DV
9 <!--
10 For production (minified) code, use:
11 <script type="text/javascript" src="dygraph-combined.js"></script>
12 -->
13 <script type="text/javascript" src="../dygraph-dev.js"></script>
14
bf0e5ca5
DV
15 <script type="text/javascript" src="data.js"></script>
16 </head>
17 <body>
18 <h3>Click the check boxes to toggle series visibility</h3>
19 <div id="div_g" style="width:600px; height:300px;"></div>
20
21 <p><b>Show Series:</b></p>
22 <p>
23 <input type=checkbox id="0" onClick="change(this)">
24 <label for="0"> A</label><br/>
25 <input type=checkbox id="1" checked onClick="change(this)">
26 <label for="1"> B</label>
27 </p>
28
29 <p>g.visibility() = <span id="visibility"></span></p>
30
31
32 <script type="text/javascript">
33 g = new Dygraph(
34 document.getElementById("div_g"),
35 NoisyData, {
36 rollPeriod: 7,
37 errorBars: true,
38 visibility: [false, true]
39 }
40 );
41 setStatus();
42
43 function setStatus() {
44 document.getElementById("visibility").innerHTML =
45 g.visibility().toString();
46 }
47
48 function change(el) {
49 g.setVisibility(parseInt(el.id), el.checked);
50 setStatus();
51 }
52 </script>
53
54 </body>
55</html>