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>
9 <script type=
"text/javascript" src=
"../strftime/strftime-min.js"></script>
10 <script type=
"text/javascript" src=
"../rgbcolor/rgbcolor.js"></script>
11 <script type=
"text/javascript" src=
"../dygraph-canvas.js"></script>
12 <script type=
"text/javascript" src=
"../dygraph.js"></script>
13 <script type=
"text/javascript" src=
"data.js"></script>
16 <p>Hover, click and zoom to test the callbacks:
</p>
17 <div id=
"div_g" style=
"width:600px; height:300px; position:relative;">
20 <script type=
"text/javascript">
24 document.getElementById(
"div_g"),
30 highlightCallback: function(e, x, pts) {
31 for (var i =
0; i < pts.length; i++) {
32 var y = pts[i].canvasy;
33 lines[i].style.display =
"";
34 lines[i].style.top = y +
"px";
35 if (i ==
0) xline.style.left = pts[i].canvasx +
"px";
37 xline.style.display =
"";
40 unhighlightCallback: function(e) {
41 for (var i =
0; i <
2; i++) {
42 lines[i].style.display =
"none";
44 xline.style.display =
"none";
49 for (var i =
0; i <
2; i++) {
50 var line = document.createElement(
"div");
51 line.style.display =
"none";
52 line.style.width =
"100%";
53 line.style.height =
"1px";
54 line.style.backgroundColor =
"black";
55 line.style.position =
"absolute";
56 document.getElementById(
"div_g").appendChild(line);
60 xline = document.createElement(
"div");
61 xline.style.display =
"none";
62 xline.style.width =
"1px";
63 xline.style.height =
"100%";
64 xline.style.top =
"0px";
65 xline.style.backgroundColor =
"black";
66 xline.style.position =
"absolute";
67 document.getElementById(
"div_g").appendChild(xline);