X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Fcrosshair.html;h=c444686f16b67ffcf532b4275977cbff50fa0a67;hb=606568fef36a321148399da4c58a05e2753ac2f9;hp=3d8a254e7c1c432ae1d382616cc229280bb39cef;hpb=d16579a0ee27bb61214365d5de803121bab2a305;p=dygraphs.git
diff --git a/tests/crosshair.html b/tests/crosshair.html
index 3d8a254..c444686 100644
--- a/tests/crosshair.html
+++ b/tests/crosshair.html
@@ -1,10 +1,12 @@
+
crosshairs
-
+
+
@@ -27,16 +29,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";
@@ -46,6 +57,7 @@
}
xline = document.createElement("div");
+ xline.style.display = "none";
xline.style.width = "1px";
xline.style.height = "100%";
xline.style.top = "0px";