How to avoid labels overlapping in a D3.js pie chart?
问题 I'm drawing a pie chart using D3.js with a quite simple script. The problem is that when slices are small, their labels overlap. What options do I have to prevent them from overlapping? Does D3.js have built-in mechanisms I could exploit? Demo: http://jsfiddle.net/roxeteer/JTuej/ var container = d3.select("#piechart"); var data = [ { name: "Group 1", value: 1500 }, { name: "Group 2", value: 500 }, { name: "Group 3", value: 100 }, { name: "Group 4", value: 50 }, { name: "Group 5", value: 20 }