Line chart
A trend over time, one line per series, with reference lines and a synced crosshair.
ChartLine draws one line per series over a category, datetime or numeric x axis. Use it for a trend over time, such as requests, revenue or latency, and its comparison series for the previous period.
ChartLine Connecting to the DMS preview…
Usage
import { ChartLine } from "@antelopejs/interface-dms/base/chart";
static latency = ChartLine({
title: "$api.metrics.latency",
fetchUrl: "/api/metrics/latency",
periodScope: "api",
xaxisType: "datetime",
curve: "smooth",
annotations: [{ y: 300, label: "SLO", color: "error" }],
syncGroup: "metrics",
});
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 | – | |
color Appearance | string | string[] | – | |
height Appearance | string | – | |
width Appearance | number | – | |
showTooltip Appearance | boolean | true | |
showLegend Appearance | boolean | true | |
legendPosition Appearance | "top" | "bottom" | – | |
showGrid Appearance | boolean | true | |
yRange.min* Appearance | number | – | |
yRange.max* Appearance | number | – | |
comparisonStyle Appearance | "dashed" | "solid" | "dimmed" | – | |
smooth Appearance | boolean | true | |
curve Appearance | "smooth" | "straight" | "stepline" | – | |
xaxisType Appearance | "category" | "datetime" | "numeric" | – | |
strokeWidth Appearance | number | – |
Recipes
Steps instead of curves
curve: "stepline" draws a value that changes by steps (replicas, plan limits). curve wins over smooth when both are set.
Read a stacked grid together
Give every chart of a metrics grid the same syncGroup: hovering one moves the tooltip of all of them.
