dygraphs
Version:
dygraphs is a fast, flexible open source JavaScript charting library.
53 lines (46 loc) • 1.57 kB
HTML
<html>
<head>
<meta charset="UTF-8">
<title>visibility</title>
<link rel="stylesheet" type="text/css" href="../dist/dygraph.css" />
<link rel="stylesheet" type="text/css" href="../common/vextlnk.css" />
<script type="text/javascript" src="../dist/dygraph.js"></script>
<script type="text/javascript" src="data.js"></script>
</head>
<body>
<h3>Click the check boxes to toggle series visibility</h3>
<div id="div_g" style="width:600px; height:300px;"></div>
<p><b>Show Series:</b></p>
<p>
<input type=checkbox id="0" onClick="change(this)">
<label for="0"> A</label><br />
<input type=checkbox id="1" checked onClick="change(this)">
<label for="1"> B</label><br />
<input type=checkbox id="2" checked onClick="change(this)">
<label for="2"> C</label>
</p>
<p>g.visibility() = <span id="visibility"></span></p>
<script type="text/javascript"><!--//--><![CDATA[//><!--
function setStatus() {
document.getElementById("visibility").innerHTML =
g.visibility().toString();
}
function change(el) {
g.setVisibility(parseInt(el.id), el.checked);
setStatus();
}
Dygraph.onDOMready(function onDOMready() {
g = new Dygraph(
document.getElementById("div_g"),
NoisyDataABC, {
rollPeriod: 7,
errorBars: true,
visibility: [false, true, true]
}
);
setStatus();
});
//--><!]]></script>
</body>
</html>