Velocity X Components

Stats & Numbers

Donut Breakdown Chart

Shows how a total splits across a handful of categories — revenue by plan, traffic by channel, tickets by type — as a donut with a legend and an exact-value table underneath. Every segment carries a fixed colour, a direct percentage and a legend row at once, so the breakdown reads correctly even for colourblind viewers or screen readers.

Subscription Included with the Velocity Components subscription.
bash
$ velocityx add donut-breakdown-chart

Built for astro.

Full docs for Donut Breakdown Chart →

Needs a licence key — subscribe here, then velocityx loginonce.

astro v1.0.1
Donut Breakdown Chart
Revenue by plan
Revenue by plan: Enterprise 50%, Pro 33%, Starter 13%, Trial 4%
  • Enterprise $48.2k 50%
  • Pro $31.4k 33%
  • Starter $12.8k 13%
  • Trial $4.1k 4%
Revenue by plan — exact values
SegmentValueShare
Enterprise $48.2k 50%
Pro $31.4k 33%
Starter $12.8k 13%
Trial $4.1k 4%

Props

NameTypeRequiredDefaultDescription
titlestringNo'Revenue by plan'
segmentsDonutSegment[]No[ { label: 'Enterprise', value: 48200, valueText: '$48.2k' }, { label: 'Pro', value: 31400, valueText: '$31.4k' }, { label: 'Starter', value: 12800, valueText: '$12.8k' }, { label: 'Trial', value: 4100, valueText: '$4.1k' }, ]
totalTextstringNoPre-formatted total centred in the donut. Defaults to the summed value.
totalLabelstringNo'Total'
classNamestringNo''

File this creates

The CLI writes this path into your project, relative to its root — nothing else moves.

text
components/velocity/donut-breakdown-chart/DonutBreakdownChart.astro

Using the Donut Breakdown Chart component

Install it with velocityx add donut-breakdown-chart. The CLI writes the source straight into your project — no runtime dependency, no registry lock-in, and it themes itself from the same primary-*/accent-* scale as the rest of the library.

More from Stats & Numbers.