Issue: Not able to give background color to the whole content and I assume this is because I gave CSS style ("overflow", "visible") or may be because of (position: absolute) on parent. I want whole content to take background color as either grey or black. I have also shared fiddle link ( actual code is written in react ).
https://jsfiddle.net/m1r0428k/1/
React.useEffect(() => {
// calling legend function and passing div id to function
colorLegend("#legend");
}, [dep]);
function colorLegend(legend: string) {
// logic
select(legend)
.attr("height", 100 + "%")
.attr("width", 100 + "%")
.style("background-color", "black")
.style("border-radius", "5px")
.call(colorLegend);
}
return (
<div style={{position: "absolute",right: 16,top: 10,backgroundColor:
"grey"}}>
<div id="legend"></div>
</div>
);