I have simple tooltip question but I couldn't find the solution. The codes below draw a doughnut chart. When user mouseovers a segment of pie, the tooltip should pop up in the middle of doughnut. But I don't know why it does not work here. Can anyone help to point out the problem? Here is JSbins
If I change the line 36 to d3.select(#pieChart)
, the tooltip works. However, for some reasons, I want the tooltip to append on svg.
Thanks a lot!