My tooltip is going out of the box in d3 chart.
Can someone guide me what I am doing wrong ?
css -
div.tooltip {
position: absolute;
width: 240px;
height: 140px;
font: 14px sans-serif;
background: white;
border: 0px;
box-shadow: 0 0 5px #999999;
border-radius: 2px;
pointer-events: none;
text-align: left;
padding: 5px 0 5px 15px;
opacity: 100;
}
div for tooltip -
// Define the div for the tooltip
var div = d3
.select("body")
.append("div")
.attr("class", "tooltip")
.style("opacity", 0);
I am thing there's some issue with mousemove
, mouseover
please guide me.
code sandbox here - https://codesandbox.io/s/wizardly-butterfly-2nnbw