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

Pie chart

Parts of a whole as slices, each labelled.

ChartPie draws parts of a whole as slices and always labels them. Prefer a donut when a total belongs in the middle.

Pie ChartChartPie
Connecting to the DMS preview…
ConnectingDMS 0.9.55 options set

Usage

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

static sources = ChartPie({
  title: "$marketing.traffic.sources",
  fetchUrl: "/api/marketing/traffic/sources",
});

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 Pie Chart block
OptionTypeDefaultDescription
titleContentstring–
descriptionContentstring–
colorAppearancestring | string[]–
heightAppearancestring–
widthAppearancenumber–
showTooltipAppearancebooleantrue
showLegendAppearancebooleantrue
legendPositionAppearance"top" | "bottom"–

Recipes

Keep slices few

Group the long tail into "Other" on the server: past six slices a pie stops reading.

Next steps

Charts

Colors, annotations, events and the other chart types.

Chart card

Frame the chart with its headline value.