A D3 plugin to position labels at angles within or around pie and donut graphs.
An example of positioning labels inside the slices of donut graph is on bl.ocks.org.
The following methods are available on instances of
arcSpecifies the D3 arc used for making calculations.
orientSpecifies the orientation of the labels in relation to the slices. Valid values are
"middle-or-inside", labels are placed within slices if the width of the slice at the centroid is large enough for the label; otherwise it is placed to the inside of the slice.
orientationReturns the actual orientation of the label, which is usually the specified orientation, unless the orientation is set to
"middle-or-inside", in which case it returns the calculated orientation, either
offsetThe distance to offset labels from their anchor point. When the orientation of the label is inside the slice, offsetting a label moves it toward the center of the circle. When the orientation of the label is outside the slice, offsetting a label moves it away from the center of the circle. Offsets have no effect for a label oriented in the middle of the slice.
fontSizeSpecifies the font size to use for labels. Accepts either a constant or a function that will be given individual datapoints. If the function returns null, the default font size will be used.
maxFontSizeSpecifies the maximum font size to use when scaling labels to the size of the slice.
minFontSizeSpecifies the minimum font size to use when scaling labels to the size of the slice.