4 <meta http-equiv=
"X-UA-Compatible" content=
"IE=EmulateIE7; IE=EmulateIE9">
5 <title>crosshairs
</title>
7 <script type=
"text/javascript" src=
"../excanvas.js"></script>
10 For production (minified) code, use:
11 <script type=
"text/javascript" src=
"dygraph-combined.js"></script>
13 <script type=
"text/javascript" src=
"../dygraph-dev.js"></script>
15 <script type=
"text/javascript" src=
"data.js"></script>
18 <p>Hover, click and zoom to test the callbacks:
</p>
19 <div id=
"div_g" style=
"width:600px; height:300px; position:relative;">
22 <script type=
"text/javascript">
26 document.getElementById(
"div_g"),
32 highlightCallback: function(e, x, pts) {
33 for (var i =
0; i < pts.length; i++) {
34 var y = pts[i].canvasy;
35 lines[i].style.display =
"";
36 lines[i].style.top = y +
"px";
37 if (i ==
0) xline.style.left = pts[i].canvasx +
"px";
39 xline.style.display =
"";
42 unhighlightCallback: function(e) {
43 for (var i =
0; i <
2; i++) {
44 lines[i].style.display =
"none";
46 xline.style.display =
"none";
51 for (var i =
0; i <
2; i++) {
52 var line = document.createElement(
"div");
53 line.style.display =
"none";
54 line.style.width =
"100%";
55 line.style.height =
"1px";
56 line.style.backgroundColor =
"black";
57 line.style.position =
"absolute";
58 document.getElementById(
"div_g").appendChild(line);
62 xline = document.createElement(
"div");
63 xline.style.display =
"none";
64 xline.style.width =
"1px";
65 xline.style.height =
"100%";
66 xline.style.top =
"0px";
67 xline.style.backgroundColor =
"black";
68 xline.style.position =
"absolute";
69 document.getElementById(
"div_g").appendChild(xline);