X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=inline;f=tests%2Fcrosshair.html;h=f3720f55b8f018e0efbe9218916deaf793221e66;hb=4828ae918819d9ddd6b24ab6419b205d4a3b0417;hp=e6c4adf6e98a5119960d759bd85dc54f9675fdb1;hpb=bb66df31ffc04645f3227d81651574dd5d4561ae;p=dygraphs.git
diff --git a/tests/crosshair.html b/tests/crosshair.html
index e6c4adf..f3720f5 100644
--- a/tests/crosshair.html
+++ b/tests/crosshair.html
@@ -1,13 +1,17 @@
+
+
crosshairs
-
-
-
-
+
+
+
@@ -28,16 +32,25 @@
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.top = y + "px";
if (i == 0) xline.style.left = pts[i].canvasx + "px";
}
+ xline.style.display = "";
+ },
+ unhighlightCallback: function(e) {
+ for (var i = 0; i < 2; i++) {
+ lines[i].style.display = "none";
+ }
+ xline.style.display = "none";
}
}
);
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";
@@ -47,6 +60,7 @@
}
xline = document.createElement("div");
+ xline.style.display = "none";
xline.style.width = "1px";
xline.style.height = "100%";
xline.style.top = "0px";