score:3

Accepted answer

when you do this:

d3.select(this).append("text")

you're appending a <text> element to a <circle> element, and this will simply not work.

there are alternatives. the simplest one is appending a <title>:

 d3.select(this).append("title")

but a title is very limited. alternatively, you can use a div to show the tooltip (check my answer here: https://stackoverflow.com/a/35665974/5768908)


Related Query

More Query from same tag