I would like to recreate something similar to the following examples:
http://bl.ocks.org/mbostock/3888852
http://bl.ocks.org/mbostock/1305111
The only d
For this, you need to adjust the .innerRadius()
and/or .outerRadius()
dynamically for each appended pie chart, for example
svg.selectAll(".arc")
.data(function(d) { return pie(d.ages); })
.enter().append("path")
.attr("class", "arc")
.attr("d", function(d, i) { return arc.innerRadius(radius - 30 * Math.random())(d, i); })
.style("fill", function(d) { return color(d.data.name); });
Complete example here. In a real example, you'd want to specify the radius in the data and reference that instead of making up a random number for each segment of the pie chart. Then you can also have the same radius for all the segments in the same pie chart.