D3-graph-gallery icon indicating copy to clipboard operation
D3-graph-gallery copied to clipboard

tooltip d3.v6 example mouse position

Open sonseungbeom opened this issue 3 years ago • 0 comments

https://www.d3-graph-gallery.com/graph/connectedscatter_tooltip.html

in the d3.v6 example.

const mousemove = function(event,d) { Tooltip .html("Exact value: " + d.value) .style("left", (event.x)/2 + "px") .style("top", (event.y)/2 + "px") }

(event.x)/2 and (event.y)/2 is not mouse mouse position. x position is d3.pointer(event)[0] + 70 y position is d3.pointer(event)[1]

sonseungbeom avatar Aug 20 '21 04:08 sonseungbeom