Skip to content

Donut / Pie chart

D3 chart

For all common D3 chart properties, refer to D3 chart API.

Chart.Donut

js
import { Chart } from 'intergalactic/d3-chart';

DonutChartProps

BaseChartProps<> & {...}
NameTypeDescription
groupKeynever
xScaleScaleLinear<any, any>
yScaleScaleLinear<any, any>
innerRadiusnumber
halfsizeboolean
innerLabelReact.ReactNode

Donut

It have children components Pie, Label, EmptyData.

js
import { Donut } from 'intergalactic/d3-chart';

<Donut>
  <Donut.EmptyData />
  <Donut.Pie />
  <Donut.Label />
</Donut>;

DonutProps

& {...}
NameTypeDescription
innerRadiusnumber Inner radius
outerRadiusnumber Outer radius
halfsizeboolean Semi donut
durationnumber Animation duration in ms. Set `0` to disable animation.
paddingAnglenumber Additional padding between segments in radians.
patterns Enables charts patterns that enhances charts accessibility

Released under the MIT License.

Released under the MIT License.