dygraphs
Version:
dygraphs is a fast, flexible open source JavaScript charting library.
75 lines (67 loc) • 1.94 kB
HTML
<html>
<head>
<meta charset="UTF-8">
<title>crosshairs</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="../extras/crosshair.js"></script>
<script type="text/javascript" src="data.js"></script>
</head>
<body>
<p>Vertical crosshair:</p>
<div id="div_g_v" style="width:600px; height:300px; position:relative;">
</div>
<p>Horizontal crosshairs:</p>
<div id="div_g_h" style="width:600px; height:300px; position:relative;">
</div>
<p>Both crosshairs:</p>
<div id="div_g_b" style="width:600px; height:300px; position:relative;">
</div>
<script type="text/javascript"><!--//--><![CDATA[//><!--
Dygraph.onDOMready(function onDOMready() {
gv = new Dygraph(
document.getElementById("div_g_v"),
NoisyData,
{
rollPeriod: 7,
showRoller: true,
errorBars: true,
plugins: [
new Dygraph.Plugins.Crosshair({
direction: "vertical"
})
]
}
);
gh = new Dygraph(
document.getElementById("div_g_h"),
NoisyData, {
rollPeriod: 7,
showRoller: true,
errorBars: true,
plugins: [
new Dygraph.Plugins.Crosshair({
direction: "horizontal"
})
]
}
);
gb = new Dygraph(
document.getElementById("div_g_b"),
NoisyData, {
rollPeriod: 7,
showRoller: true,
errorBars: true,
plugins: [
new Dygraph.Plugins.Crosshair({
direction: "both"
})
]
}
);
});
//--><!]]></script>
</body>
</html>