PieLabels
Name: Pie Labels
Description: Suitable for use with
Pie, displays data labelsUsage: The data in
data$must have alabelfield to display the label text
Example:
chart.data$.next([
[
{
label: 'Taipei',
value: 50000
},
{
label: 'Taichung',
value: 40000
},
{
label: 'Kaohsiung',
value: 30000
}
]
])
params$
Type:
Partial<PieLabelsParams>Fields:
Name Description Type outerRadius Drawing function numberouterRadiusWhileHighlight Text (line) attribute numberstartAngle Starting angle of the arc numberendAngle Ending angle of the arc numberlabelCentroid Relative position of the label at the center of the arc radius (0 is the center of the circle, 2 is the edge of the circle) numberlabelColorType Label color type ColorTypelabelFn Function to display label text (d: ComputedDatumSeries) => string
Detailed Types
type ColorType = 'none' | 'label' | 'labelContrast' | 'primary' | 'secondary' | 'background'
interface ComputedDatumSeries {
id: string
index: number
label: string
visible: boolean
data: any
value: number | null
color: string
seriesIndex: number
seriesLabel: string
seq: number
}
- Default values:
{
outerRadius: 0.85,
outerRadiusWhileHighlight: 0.9,
startAngle: 0,
endAngle: Math.PI * 2,
labelCentroid: 2.1,
labelColorType: 'primary',
labelFn: d => String(d.label),
}