Search code examples
d3.jsdonut-chart

Pie (donut) chart tooltips


I want to use exactly this d3 donut chart.

This 3d chart

However, instead of showing percentage, I'd like to show the raw datas that I am providing.

Ideally, the percentage could be shown (as it is now) and I could show the raw datas for each donut part using an onmouseover tooltip!

Can't make it work.

Thanks a lot for any help!


Solution

  • Are you looking for this,I update the fiddle with tool tip, Initially add a div to the body i.e.

    var div = d3.select("body").append("div").attr("class", "tooltip");
    

    then whenever user makes a mouseover or mousemove on the paths/arcs do the necessary.

    have a look in http://jsfiddle.net/Q3dhh/25/