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.
ChartDonut Connecting to the DMS preview…
Usage
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
| Option | Type | Default | Description |
|---|---|---|---|
title Content | string | – | |
description Content | string | – | |
centralLabel Content | string | – | |
centralSubLabel Content | string | – | |
color Appearance | string | string[] | – | |
height Appearance | string | – | |
width Appearance | number | – | |
showTooltip Appearance | boolean | true | |
showLegend Appearance | boolean | true | |
legendPosition Appearance | "top" | "bottom" | – | |
arcWidth Appearance | number | – |
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.
