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>
16 <style type=
"text/css">
19 background-color: black;
21 pointer-events: none; /* let mouse events fall through to the chart */
34 <p>Hover, click and zoom to test the callbacks:
</p>
35 <div id=
"div_g" style=
"width:600px; height:300px; position:relative;">
38 <script type=
"text/javascript">
42 document.getElementById(
"div_g"),
48 highlightCallback: function(e, x, pts) {
49 for (var i =
0; i < pts.length; i++) {
50 var y = pts[i].canvasy;
51 lines[i].style.visibility =
"visible";
52 lines[i].style.top = y +
"px";
53 if (i ==
0) xline.style.left = pts[i].canvasx +
"px";
55 xline.style.visibility =
"visible";
58 unhighlightCallback: function(e) {
59 for (var i =
0; i <
2; i++) {
60 lines[i].style.visibility =
"hidden";
62 xline.style.visibility =
"hidden";
67 for (var i =
0; i <
2; i++) {
68 var line = document.createElement(
"div");
69 line.className =
"line yline";
70 document.getElementById(
"div_g").appendChild(line);
74 xline = document.createElement(
"div");
75 xline.className =
"line xline";
76 xline.style.top =
"0px";
77 document.getElementById(
"div_g").appendChild(xline);