The layout function created by the d3.pie() generator takes an array of data and returns an object array containing the original data plus computed start and end angles that can be used to render arcs. It's perfect for creating pie and doughnut charts. The function can be configured with the methods listed in the following table:
Method |
Description |
startAngle(angle) |
This method changes the angle, in radians, where the pie starts. The default is 0 (12 o'clock). |
endAngle(angle) |
This method changes the angle, in radians, where the pie ends. The default is Math.PI * 2. |
value(function) |
This method receives an accessor function that returns the (numerical) value for each datum, when necessary. The default is d => d. |
padAngle() |
This method returns an angular separation in radians between adjacent arcs. |
sort(comparator) |
This... |