score:2

Accepted answer

Not used JSBin a lot so I used JSFiddle : https://jsfiddle.net/thatoneguy/0qgzLk2L/

You can't append a div to svg so you have to create a container like so :

 var svgContainer = d3.select('#pieChart');

And then append the svg to this :

var svg = svgContainer.append('svg')

And now use the container for the tooltips :

var tooltip = svgContainer
      .append('div')

Related Query

More Query from same tag