From 6a24c58c8be15ed8b27d0a86f05fe2fd8b41e3a1 Mon Sep 17 00:00:00 2001 From: terrtia Date: Mon, 29 Jan 2024 10:30:53 +0100 Subject: [PATCH] fix: [heatmap] fix tooltip position --- var/www/static/js/d3/heatmap_week_hour.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/var/www/static/js/d3/heatmap_week_hour.js b/var/www/static/js/d3/heatmap_week_hour.js index f41e8985..4696a052 100644 --- a/var/www/static/js/d3/heatmap_week_hour.js +++ b/var/www/static/js/d3/heatmap_week_hour.js @@ -50,7 +50,12 @@ const create_heatmap_week_hour = (container_id, data, options) => { .style("stroke", "black") //.style("stroke-opacity", 1) + var xPosition = d3.mouse(this)[0] + margin.left; + var yPosition = d3.mouse(this)[1] + margin.top + window.scrollY + 100; + tooltip.html(d.date + " " + d.hour + "-" + (d.hour + 1) + "h: " + d.count + " messages") + .style("left", xPosition + "px") + .style("top", yPosition + "px"); } const mouseleave = function(d) { tooltip.style("opacity", 0)