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

Charts

Thirteen chart blocks drawn with ApexCharts — how to pick one, the options they share, colors, reference lines and synced crosshairs.

Each chart block draws one chart type. Use it on its own, or — most often — inside a ChartCard, which adds the headline value and the comparison legend. Charts render on the frontend with ApexCharts; the options map onto ApexCharts concepts, but you never touch the library: the backend sends a serializable description.

Line ChartChartLine
Connecting to the DMS preview…
ConnectingDMS 0.9.57 options set

Pick a chart

BlockFamilyUse it for
ChartLineXYA trend over time.
ChartAreaXYA trend whose volume matters, stacked or not.
ChartRangeAreaXYA band between a low and a high: percentiles, forecasts.
ChartBarXYComparing categories, horizontal bars.
ChartColumnXYComparing categories or periods, vertical columns.
ChartScatterXYThe relation between two measures.
ChartMixedXYLines, areas and columns on one axis.
ChartRadarXYSeveral measures of a few items, on spokes.
ChartCandlestickXYOpen, high, low and close per period.
ChartDonutCircularParts of a whole, with a figure in the middle.
ChartPieCircularParts of a whole, labelled on the slices.
ChartRadialBarCircularProgress of a few measures towards 100 %.
ChartHeatmapGridIntensity across two dimensions: hours × days.

Every builder comes from @antelopejs/interface-dms/base/chart and is pinned to its ChartType: pass options without a type, the builder injects it.

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

static requests = ChartLine({ title: "Requests", fetchUrl: "/api/metrics/requests", xaxisType: "datetime" });
static plans = ChartDonut({ title: "Plans", fetchUrl: "/api/metrics/plans", centralLabel: "Accounts" });

Data shapes

FamilystaticDataset and route answer
XYChartSeries[]: { name, data, type?, color?, strokeWidth?, strokeDashArray? }. data holds { x, y, label? } points or bare numbers.
Range areaPoints { x, y: [low, high] }.
CandlestickPoints { x, y: [open, high, low, close] }.
CircularDonutRecord[]: { label, value }.
HeatmapOne series per row, each point { x, y } with y the intensity.

A route answers { series, comparisonSeries? }. Series names follow the $-prefix convention.

Colors

color takes a semantic name (primary, success), a Nuxt UI shade token (primary-500, neutral-950), a CSS variable (--usage-accent or var(--usage-accent)), or a hex / rgb / hsl literal; an array colors each series. Shade steps are 50, 100 to 900 by 100, and 950; accent aliases primary. A semantic name follows the theme's selected shade, while a fixed shade stays fixed across light and dark modes.

Define a custom variable on :root or an ancestor of body, without a nested expression or an inline fallback. Missing, invalid or fully transparent tokens fall back to #7c3aed. A custom component reads the same palette with the auto-imported resolveChartColor / resolveChartColors, reading useThemeRevision().value inside its computed palette so it follows theme changes.

Reference lines and bands

annotations draws horizontal reference lines through an XY plot. A y2 turns a line into a shaded band.

FieldTypePurpose
ynumberWhere the line sits on the value axis. Required.
y2numberTurns the line into a band between y and y2.
labelstringCaption at the right end, in the annotation's color.
colorChartColorValueTheme color or literal; the chart's primary by default.
dashedbooleanDashed by default; false for a solid rule.

Annotations do not move the Y range. In code, autoYRange: { padding: 0.08 } includes every y and y2 in the bounds and pads them outward by 8 %, then rounds them to a readable step; an explicit yRange wins over it.

src/pages/metrics.ts
ChartLine({
  title: "Replicas",
  fetchUrl: "/metrics/replicas",
  curve: "stepline",
  annotations: [{ y: 4, label: "max bound", color: "warning" }],
});

Synced crosshairs

Charts naming the same syncGroup share a crosshair: hovering one moves the tooltip of all of them to the same x position, which makes a grid of stacked metrics readable. Each chart keeps its own axes, colors and annotations, and still fetches and scales on its own.

Click events

Charts emit click events other blocks can watch (ChartEvents): SEGMENT_CLICK on circular charts, POINT_CLICK on XY charts (Actions & reactivity). The payload carries value for scalar points; on range areas and candlesticks value is null and the tuple arrives in values.

The escape hatch

rawOptions passes key / value pairs straight to ApexCharts when a knob is not a typed option. A plain key (markers) replaces that whole section; a dotted key (markers.size) sets one option inside it. The value is parsed as JSON when it can be. Reach for it last: raw options bypass the theme's color resolver.

Next steps

Chart card

Frame a chart with its headline value.

Line chart

Start with the most common chart.