Chart
ProAccessible Recharts plot with area, line, and grouped or stacked bar types, up to four token-coloured series, an optional legend, and a shared hover and keyboard tooltip.
Pro component. Chart is a paid component. It ships in @lusterui/react-pro, a .tgz you download from the site after purchase.
Usage
import { Chart } from "@lusterui/react-pro";
<Chart
label="Revenue by month"
data={[
{ label: "Jan", current: 10200, previous: 8300 },
{ label: "Feb", current: 10500, previous: 8900 },
{ label: "Mar", current: 11600, previous: 10300 },
]}
type="line"
series={[
{ key: "current", label: "This year", color: "series-1" },
{ key: "previous", label: "Last year", color: "comparison", variant: "dashed" },
]}
legend
yTicks={[0, 6000, 12000, 18000]}
formatValue={(v) => (v === 0 ? "$0" : `$${v / 1000}k`)}
/>
Props
| Prop | Type | Default |
|---|---|---|
label | string (required). Accessible name of the plot. | – |
data | Record<string, number | string>[] (required). Ordered rows; label is the x key and value is the default single-series y key. | – |
yTicks | number[] (required). Ascending y ticks defining the displayed value range. | – |
type | 'area' | 'line' | 'bar' | 'area' |
series | ChartSeries[], up to four numeric series using chart token colour keys. | – |
stacked | boolean, stacks bar series (bar only). | false |
legend | boolean, shows series swatches and names below the x axis. | false |
density | 'default' | 'compact', dashboard plot or compact MetricCard well. | 'default' |
formatValue | (value: number) => string, formats tick labels and the default description. | – |
formatTooltipValue | (value: number) => string, formats tooltip values and keyboard announcements. | formatValue |
interactive | boolean, enables pointer and keyboard tooltip interaction. | true |
loading | boolean, renders skeleton loading state with aria-busy. | false |
empty / error | ChartMessage, replaces the plot with a centred status or alert message. | – |
When to use something else
- A single key figure with its change: use Stat.
- Exact values the user scans, sorts, or acts on row by row: use DataTable.
- A small trend beside a KPI without axes or a tooltip: use Sparkline in a
MetricCard. - More than four series or many category labels: split into focused charts or use DataTable.
Nucleo Icons, https://nucleoapp.com/. Copyright © Nucleo. Copyright notice. Component examples use Hugeicons free (Stroke Rounded), MIT License, Copyright (c) 2025 Hugeicons. License