[data-reveal]{opacity:1!important;transform:none!important}
AntelopeJS DMS
DocumentationLine chart

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.

Line Chart ChartLine
Connecting to the DMS preview…
Connecting DMS 0.25.8 7 options set

Usage

src/pages/dashboard.ts 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
title Contentstring–
description Contentstring–
color Appearancestring | string[]–
height Appearancestring–
width Appearancenumber–
showTooltip Appearancebooleantrue
showLegend Appearancebooleantrue
legendPosition Appearance"top" | "bottom"–
showGrid Appearancebooleantrue
yRange.min* Appearancenumber–
yRange.max* Appearancenumber–
comparisonStyle Appearance"dashed" | "solid" | "dimmed"–
smooth Appearancebooleantrue
curve Appearance"smooth" | "straight" | "stepline"–
xaxisType Appearance"category" | "datetime" | "numeric"–
strokeWidth Appearancenumber–

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.