RangeBandChart
Compare series and read the change behind them, with the axes, legend and tooltip already wired.
@luc/ui/chartsWhat it shows
Read a centre estimate together with an interval around it over an ordered x axis.
Live preview
A centre line with one supplied interval: lower ≤ centre ≤ upper at every point.
<RangeBandChart
points={[
{ t: "2026-08-17", center: 100, lower: 97.2, upper: 102.6 },
{ t: "2026-08-24", center: 101.1, lower: 98.1, upper: 103.9 },
{ t: "2026-08-31", center: 102.4, lower: 99.4, upper: 105.2 },
{ t: "2026-09-07", center: 103.2, lower: 100.1, upper: 106.4 },
{ t: "2026-09-14", center: 104.6, lower: 101.2, upper: 107.8 },
{ t: "2026-09-21", center: 105.9, lower: 102.4, upper: 109.3 },
{ t: "2026-09-28", center: 106.8, lower: 103.1, upper: 110.4 },
{ t: "2026-10-05", center: 107.9, lower: 104.2, upper: 111.6 },
]}
format={{ kind: "decimal", decimals: 1 }}
bandLabel="80% interval"
height={320}
ariaLabel="Estimate with interval"
/>Controls
Height
A chart measures its container, so it always needs a definite height.
State
The surface the chart is in — loading, empty and error are drawn by the component.
Accessible name
A drawing is not readable by a screen reader, so it needs a name that states what it shows.
The same fixture as the live preview above; the controls change how it is drawn, not what it measures.
Code
import { RangeBandChart } from "@luc/ui/charts";
<RangeBandChart
points={[
{ t: "2026-08-17", center: 100, lower: 97.2, upper: 102.6 },
{ t: "2026-08-24", center: 101.1, lower: 98.1, upper: 103.9 },
{ t: "2026-08-31", center: 102.4, lower: 99.4, upper: 105.2 },
{ t: "2026-09-07", center: 103.2, lower: 100.1, upper: 106.4 },
{ t: "2026-09-14", center: 104.6, lower: 101.2, upper: 107.8 },
{ t: "2026-09-21", center: 105.9, lower: 102.4, upper: 109.3 },
{ t: "2026-09-28", center: 106.8, lower: 103.1, upper: 110.4 },
{ t: "2026-10-05", center: 107.9, lower: 104.2, upper: 111.6 },
]}
format={{ kind: "decimal", decimals: 1 }}
bandLabel="80% interval"
height={320}
ariaLabel="Estimate with interval"
state="ready"
/>Not controllable here
series / rows— The numbers are the caller's; the fixture above is the example.
Copy for an AI agentA specification an agent can act on: the import, the setup, the chosen props, the data contract and the accessibility expectation.
Implement `RangeBandChart` from Luc UI. It is: Compare series and read the change behind them, with the axes, legend and tooltip already wired.
Import it with: import { RangeBandChart } from "@luc/ui/charts";
Requires: react ^19.0.0; react-dom ^19.0.0; react-hook-form ^7.0.0 (optional, for @luc/ui/forms/react-hook-form); tailwindcss ^4.0.0; node >= 22 (repository tools). Import the stylesheet once at the app root and wrap the tree in `LucProvider`. Both come from the package that publishes @luc.
Chosen configuration: `height={320}`, `state="ready"`, `ariaLabel="Estimate with interval"`.
Accessibility: keep the component's own semantics. Do not re-implement its ARIA wiring, do not add roles it does not declare, and make sure every interactive element is reachable and operable from the keyboard with a visible focus state.
Styling: use Luc UI design tokens and the component's own props. Do not restyle with raw colour literals and do not override the component's internal structure with page CSS.
Motion: respect `prefers-reduced-motion`. The component already does, so do not disable it.
Reproduce this state:
```tsx
<RangeBandChart
points={[
{ t: "2026-08-17", center: 100, lower: 97.2, upper: 102.6 },
{ t: "2026-08-24", center: 101.1, lower: 98.1, upper: 103.9 },
{ t: "2026-08-31", center: 102.4, lower: 99.4, upper: 105.2 },
{ t: "2026-09-07", center: 103.2, lower: 100.1, upper: 106.4 },
{ t: "2026-09-14", center: 104.6, lower: 101.2, upper: 107.8 },
{ t: "2026-09-21", center: 105.9, lower: 102.4, upper: 109.3 },
{ t: "2026-09-28", center: 106.8, lower: 103.1, upper: 110.4 },
{ t: "2026-10-05", center: 107.9, lower: 104.2, upper: 111.6 },
]}
format={{ kind: "decimal", decimals: 1 }}
bandLabel="80% interval"
height={320}
ariaLabel="Estimate with interval"
state="ready"
/>
```Usage
The values are prepared by the caller: this component draws the points it is given and computes no statistic of its own, so units, scaling and any summary have to be settled before the data reaches it.
It is drawn by the ECharts engine.
Worked examples with real data are on the family overview: General
import { RangeBandChart } from "@luc/ui/charts";<RangeBandChart
points={[
{ t: "2026-08-17", center: 100, lower: 97.2, upper: 102.6 },
{ t: "2026-08-24", center: 101.1, lower: 98.1, upper: 103.9 },
{ t: "2026-08-31", center: 102.4, lower: 99.4, upper: 105.2 },
{ t: "2026-09-07", center: 103.2, lower: 100.1, upper: 106.4 },
{ t: "2026-09-14", center: 104.6, lower: 101.2, upper: 107.8 },
{ t: "2026-09-21", center: 105.9, lower: 102.4, upper: 109.3 },
{ t: "2026-09-28", center: 106.8, lower: 103.1, upper: 110.4 },
{ t: "2026-10-05", center: 107.9, lower: 104.2, upper: 111.6 },
]}
format={{ kind: "decimal", decimals: 1 }}
bandLabel="80% interval"
height={320}
ariaLabel="Estimate with interval"
/>Data contract
`points` require `t`, `center`, `lower` and `upper`; every point must satisfy `lower <= center <= upper`. The interval is supplied by the caller.
Important configuration
Label the interval with `bandLabel`, format values on the same unit, and keep the lower and upper arrays aligned with the centre line.
Guidelines
When not to use
Do not use a band to imply a confidence guarantee when the interval comes from a different estimator or sample.
Configuration
| Export | Kind | Signature |
|---|---|---|
RangeBandChart | 15 documented props | ({ points, format, bandLabel, annotations, interaction, syncGroup, title, description, state, height, className, ariaLabel, ariaDescription, onReady, onEvent, }: RangeBandChartProps) => import("@type… |
RangeBandChart props
Type: RangeBandChartProps
Values the compiler reads from the declaration.
| Prop | Type | Default | Notes |
|---|---|---|---|
annotations? | AnnotationSpec | undefined | — | |
ariaDescription? | string | undefined | — | |
ariaLabel? | string | undefined | — | |
bandLabel? | string | undefined | — | Label for the band in the tooltip, e.g. "90% interval". |
className? | string | undefined | — | |
description? | string | undefined | — | |
format? | ChartFormat | undefined | — | |
height? | string | number | undefined | — | |
interaction? | ChartInteractionSpec | undefined | — | |
onEvent? | ((event: EChartEvent) => void) | undefined | — | |
onReady? | ((chart: EChartsInstance) => void) | undefined | — | |
points | readonly BandPoint[] | — | |
state? | ChartState | undefined | — | |
syncGroup? | string | undefined | — | |
title? | string | undefined | — |
Accessibility
A chart is a picture of data, so it needs a name that states what it shows, and the numbers must exist as text somewhere on the page — in a table or a written summary — because a drawing is not readable by a screen reader and cannot be copied.
What happens on the server, and when hydration changes it.
Family
General
The shapes every product needs, on the declarative ChartSpec path.
Related