3 <title>crosshairs
</title>
5 <script type=
"text/javascript" src=
"excanvas.js"></script>
7 <script type=
"text/javascript" src=
"../dygraph-combined.js"></script>
8 <script type=
"text/javascript" src=
"../dygraph-canvas.js"></script>
9 <script type=
"text/javascript" src=
"../dygraph.js"></script>
10 <script type=
"text/javascript" src=
"data.js"></script>
13 <p>Hover, click and zoom to test the callbacks:
</p>
14 <div id=
"div_g" style=
"width:600px; height:300px; position:relative;">
17 <script type=
"text/javascript">
21 document.getElementById(
"div_g"),
27 highlightCallback: function(e, x, pts) {
28 for (var i =
0; i < pts.length; i++) {
29 var y = pts[i].canvasy;
30 lines[i].style.top = y +
"px";
31 if (i ==
0) xline.style.left = pts[i].canvasx +
"px";
38 for (var i =
0; i <
2; i++) {
39 var line = document.createElement(
"div");
40 line.style.width =
"100%";
41 line.style.height =
"1px";
42 line.style.backgroundColor =
"black";
43 line.style.position =
"absolute";
44 document.getElementById(
"div_g").appendChild(line);
48 xline = document.createElement(
"div");
49 xline.style.width =
"1px";
50 xline.style.height =
"100%";
51 xline.style.top =
"0px";
52 xline.style.backgroundColor =
"black";
53 xline.style.position =
"absolute";
54 document.getElementById(
"div_g").appendChild(xline);