From 2757f7c2a8c233e8eb5013b5a5af09fe7de9f269 Mon Sep 17 00:00:00 2001 From: Dichi13 <diciganteng01@icloud.com> Date: Thu, 25 Apr 2019 20:28:46 +0700 Subject: [PATCH] fixed tooltip position for the last time --- src/components/partials/Visualization.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/partials/Visualization.vue b/src/components/partials/Visualization.vue index f18ec1b..6d394a0 100644 --- a/src/components/partials/Visualization.vue +++ b/src/components/partials/Visualization.vue @@ -149,12 +149,12 @@ export default { //put the data (hidden) to be visible when mouseover self.tooltip = selection .append("div") - .style("position", "absolute") + .style("position", "fixed") .style("z-index", "1") .style("visibility", "hidden") .style("color", "white") .style("padding", "8px") - .style("background-color", "#626D71") + .style("background-color", "#222222cc") .style("border-radius", "6px") .style("text-align", "center") .style("width", "auto") @@ -223,8 +223,8 @@ export default { self.$emit('click-handler', d[self.columnId]) } }) - .on("mousemove", function() { - return self.tooltip.style("top", (d3.event.pageY-150) + "px").style("left", (d3.event.pageX) + "px") + .on("mousemove", function(d) { + return self.tooltip.style("top", (d3.event.pageY-window.scrollY+2) + "px").style("left", (d3.event.pageX+2) + "px") }) .on("mouseout", function() { return self.tooltip.style("visibility", "hidden") -- GitLab