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