projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Options code review, plus, remove original attr_ code.
[dygraphs.git]
/
tests
/
crosshair.html
diff --git
a/tests/crosshair.html
b/tests/crosshair.html
index
390f1e7
..
37b6daa
100644
(file)
--- a/
tests/crosshair.html
+++ b/
tests/crosshair.html
@@
-6,11
+6,29
@@
<!--[if IE]>
<script type="text/javascript" src="../excanvas.js"></script>
<![endif]-->
<!--[if IE]>
<script type="text/javascript" src="../excanvas.js"></script>
<![endif]-->
- <script type="text/javascript" src="../strftime/strftime-min.js"></script>
- <script type="text/javascript" src="../rgbcolor/rgbcolor.js"></script>
- <script type="text/javascript" src="../dygraph-canvas.js"></script>
- <script type="text/javascript" src="../dygraph.js"></script>
+ <!--
+ For production (minified) code, use:
+ <script type="text/javascript" src="dygraph-combined.js"></script>
+ -->
+ <script type="text/javascript" src="../dygraph-dev.js"></script>
+
<script type="text/javascript" src="data.js"></script>
<script type="text/javascript" src="data.js"></script>
+ <style type="text/css">
+ .line {
+ visibility: hidden;
+ background-color: black;
+ position: absolute;
+ pointer-events: none; /* let mouse events fall through to the chart */
+ }
+ .yline {
+ width: 100%;
+ height: 1px;
+ }
+ .xline {
+ height: 100%;
+ width: 1px;
+ }
+ </style>
</head>
<body>
<p>Hover, click and zoom to test the callbacks:</p>
</head>
<body>
<p>Hover, click and zoom to test the callbacks:</p>
@@
-30,40
+48,32
@@
highlightCallback: function(e, x, pts) {
for (var i = 0; i < pts.length; i++) {
var y = pts[i].canvasy;
highlightCallback: function(e, x, pts) {
for (var i = 0; i < pts.length; i++) {
var y = pts[i].canvasy;
- lines[i].style.
display = "
";
+ lines[i].style.
visibility = "visible
";
lines[i].style.top = y + "px";
if (i == 0) xline.style.left = pts[i].canvasx + "px";
}
lines[i].style.top = y + "px";
if (i == 0) xline.style.left = pts[i].canvasx + "px";
}
- xline.style.
display = "
";
+ xline.style.
visibility = "visible
";
},
unhighlightCallback: function(e) {
for (var i = 0; i < 2; i++) {
},
unhighlightCallback: function(e) {
for (var i = 0; i < 2; i++) {
- lines[i].style.
display = "none
";
+ lines[i].style.
visibility = "hidden
";
}
}
- xline.style.
display = "none
";
+ xline.style.
visibility = "hidden
";
}
}
);
for (var i = 0; i < 2; i++) {
var line = document.createElement("div");
}
}
);
for (var i = 0; i < 2; i++) {
var line = document.createElement("div");
- line.style.display = "none";
- line.style.width = "100%";
- line.style.height = "1px";
- line.style.backgroundColor = "black";
- line.style.position = "absolute";
+ line.className = "line yline";
document.getElementById("div_g").appendChild(line);
lines.push(line);
}
xline = document.createElement("div");
document.getElementById("div_g").appendChild(line);
lines.push(line);
}
xline = document.createElement("div");
- xline.style.display = "none";
- xline.style.width = "1px";
- xline.style.height = "100%";
+ xline.className = "line xline";
xline.style.top = "0px";
xline.style.top = "0px";
- xline.style.backgroundColor = "black";
- xline.style.position = "absolute";
document.getElementById("div_g").appendChild(xline);
</script>
</body>
document.getElementById("div_g").appendChild(xline);
</script>
</body>