Skip to content

Charts

IChartLegend

The legend IBarChart and ILineChart draw for themselves, available on its own to place beside a title, in a card header, or above two charts that share a scale.

  • North
  • South
  • East

A series without a name is labelled by its key, so the shape you already pass to a chart works here unchanged.

  • north
  • south
  • east

Colour follows the entity

A series takes its colour from its position in the array unless you pin it with slot. Pin every series that can be filtered in and out, so its colour survives the ones around it disappearing.

  • North
  • South
  • East
  • South
  • East

The palette defines eight categorical slots, and repeats beyond that.

Highlighting one

active is the index of the highlighted entry, and dims the rest. Drive it from your own hover handling.

  • North
  • South
  • East

Beside a chart

A chart with two or more series draws its own legend, so pass :legend="false" before placing one yourself — otherwise the page shows two.

Revenue by quarter

  • North
  • South
  • East
  • North
  • South
  • East
Revenue by quarter and region
Category NorthSouthEast
Q1€18,200€12,400€9,100
Q2€22,600€15,100€11,800
Q3€20,100€17,400€14,200

Props

PropTypeDefaultDescription
seriesChartSeries[]Entries to label. Required
activenumberIndex to highlight; the rest are dimmed
unstyledbooleanDrop built-in classes
classstringMerged with the built-in classes
ui{ root?, item?, swatch?, name? }Per-slot class overrides
ts
interface ChartSeries {
  key: string
  name?: string
  slot?: number
}