[data-reveal]{opacity:1!important;transform:none!important}
Donut chart
Components

Donut chart

Parts of a whole on a ring, with a central label.

ChartDonut draws parts of a whole on a ring, with an optional central label and sub-label. Its data is a list of { label, value } records.

Donut ChartChartDonut
Connecting to the DMS preview…
ConnectingDMS 0.9.57 options set

Usage

src/pages/dashboard.ts
import { ChartDonut } from "@antelopejs/interface-dms/base/chart";

static plans = ChartDonut({
  title: "$saas.accounts.by_plan",
  fetchUrl: "/api/saas/accounts/by-plan",
  centralLabel: "$saas.accounts.total",
});

The route answers { series } in the shape listed under Data shapes. Wrap the chart in a ChartCard to add a headline value and a comparison.

Options

Options of the Donut Chart block
OptionTypeDefaultDescription
titleContentstring–
descriptionContentstring–
centralLabelContentstring–
centralSubLabelContentstring–
colorAppearancestring | string[]–
heightAppearancestring–
widthAppearancenumber–
showTooltipAppearancebooleantrue
showLegendAppearancebooleantrue
legendPositionAppearance"top" | "bottom"–
arcWidthAppearancenumber–

Recipes

Labels on the slices

A donut labels each slice only when the ring can hold the text: from arcWidth: 35 up. The default ring shows none; the legend and the tooltip carry the values.

Next steps

Charts

Colors, annotations, events and the other chart types.

Chart card

Frame the chart with its headline value.