I am having a d3js v5 project with angular 5 . I have some issues that mouseover event is not triggered on the text element placed in the center of it.
my project code is available at https://stackblitz.com/edit/angular-menuni?embed=1&file=src/app/app.component.ts
the issue is if you place a mouse over the text named "Total" it should display the tool tip . however it is not displaying the tooltip and showing a different tool tip that i expected.some time it display the tool tip intended for the enroute section of the doughntu chart.
the following is the code that adde the mouseover event on the text total
let txtlabel = g.append("text")
.transition().delay(2000);
txtlabel
.attr("text-anchor", "middle")
.attr("font-size", (labelSize)+'em')
.attr("dy", '-1.5em')
.text("Total");
txtlabel
.on('mouseover', function(d) {
div
.style("opacity", .9);
div.html(
"<span>"+ "Total" + " : " + total +"</span>" )
.style("left", (d3.event.pageX - 40) + "px")
.style("top", (d3.event.pageY - 40) + "px");
})
.on('mousemove', function(d) {
div
.style("opacity", .9);
div.html(
"<span>"+ "Total" + " : " + total +"</span>" )
.style("left", (d3.event.pageX - 40) + "px")
.style("top", (d3.event.pageY - 40) + "px");
})
.on('mouseout', function(d) {
div
.style("opacity", 0);
});
really appreciate any help.
