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