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

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 — requests, revenue, latency — and its comparison series for the previous period.

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

Usage

src/pages/dashboard.ts
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

Options of the Line Chart block
OptionTypeDefaultDescription
titleContentstring–
descriptionContentstring–
colorAppearancestring | string[]–
heightAppearancestring–
widthAppearancenumber–
showTooltipAppearancebooleantrue
showLegendAppearancebooleantrue
legendPositionAppearance"top" | "bottom"–
showGridAppearancebooleantrue
yRange.min*Appearancenumber–
yRange.max*Appearancenumber–
comparisonStyleAppearance"dashed" | "solid" | "dimmed"–
smoothAppearancebooleantrue
curveAppearance"smooth" | "straight" | "stepline"–
xaxisTypeAppearance"category" | "datetime" | "numeric"–
strokeWidthAppearancenumber–

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.

Next steps

Charts

Colors, annotations, events and the other chart types.

Chart card

Frame the chart with its headline value.