I have a donut chart which updates data on click. I want to add labels to the same data. I am currently using the d3.js javascript library. Here is my code on jsfid
Please take a look at: http://nvd3.org/examples/pie.html or http://bl.ocks.org/Guerino1/2295263. Check the code and you should be able to answer this question fairly easy. Have fun!
You have to use the arc.centroid function. Take a look at the following examples: