Skip to content
SENVENLI UI

Donut chart

Parts of a whole, two to five, with the total in the center and exact shares; more parts fold into "Other".
Orders by channel
import { DonutChart } from "@senvenli/react/charts";

Examples

More than five parts

The smallest parts fold into "Other", so the ring stays readable.

Ring only

Without the value list, for a narrow card.

Guidelines

When to use it

  • Shares of one total, at most five parts.

Use something else when

  • There are many parts or they are compared, not summed. Bar list

Accessibility

Built in

  • A "Show as table" button shows the same data as a table, which screen readers get by default.

You provide

  • A title that says what the figure is.

API reference

DonutChart

title
string

What the chart shows, over it; leave it out when a card or a heading already says so.

aria-label
string

Names the chart when it has no visible title (a card's heading already says what it shows).

period
string
isLoading
boolean
emptyState
React.ReactNode

Shown instead of the plot when there is no data: an EmptyState size="small" or text; "No data" by default.

height
numberDefault 200
dataRequired
readonly DonutDatum[]

Two to five parts; more are folded into "Other".

valueFormatter
ChartValueFormatterDefault plain
centerLabel
string

Under the total in the center: its unit ("orders").

showList
booleanDefault true

The value list beside the ring with exact percentages; on by default.