AutocorrelationChart
Check whether a model or a process is sane, from values you computed.
@luc/ui/chartsWhat it shows
Inspect autocorrelation and partial autocorrelation across lags to judge dependence and model adequacy.
Live preview
Ten lags of a supplied ACF and PACF, with the significance band the caller computed from its own sample size.
<AutocorrelationChart
series={[
{
key: "acf",
label: "ACF",
kind: "acf",
tone: "accent",
points: [
{ x: 1, y: 0.72 },
{ x: 2, y: 0.51 },
{ x: 3, y: 0.36 },
{ x: 4, y: 0.22 },
{ x: 5, y: 0.14 },
{ x: 6, y: 0.08 },
{ x: 7, y: -0.04 },
{ x: 8, y: -0.09 },
{ x: 9, y: 0.05 },
{ x: 10, y: 0.03 },
],
},
{
key: "pacf",
label: "PACF",
kind: "pacf",
tone: "neutral",
points: [
{ x: 1, y: 0.72 },
{ x: 2, y: 0.08 },
{ x: 3, y: -0.05 },
{ x: 4, y: 0.11 },
{ x: 5, y: 0.02 },
{ x: 6, y: -0.07 },
{ x: 7, y: 0.04 },
{ x: 8, y: -0.02 },
{ x: 9, y: 0.06 },
{ x: 10, y: -0.01 },
],
},
]}
band={0.31}
bandLabel="±1.96/√n"
format={{ kind: "number", decimals: 2, signed: true }}
height={320}
ariaLabel="Autocorrelation to lag 10"
/>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 { AutocorrelationChart } from "@luc/ui/charts";
<AutocorrelationChart
series={[
{
key: "acf",
label: "ACF",
kind: "acf",
tone: "accent",
points: [
{ x: 1, y: 0.72 },
{ x: 2, y: 0.51 },
{ x: 3, y: 0.36 },
{ x: 4, y: 0.22 },
{ x: 5, y: 0.14 },
{ x: 6, y: 0.08 },
{ x: 7, y: -0.04 },
{ x: 8, y: -0.09 },
{ x: 9, y: 0.05 },
{ x: 10, y: 0.03 },
],
},
{
key: "pacf",
label: "PACF",
kind: "pacf",
tone: "neutral",
points: [
{ x: 1, y: 0.72 },
{ x: 2, y: 0.08 },
{ x: 3, y: -0.05 },
{ x: 4, y: 0.11 },
{ x: 5, y: 0.02 },
{ x: 6, y: -0.07 },
{ x: 7, y: 0.04 },
{ x: 8, y: -0.02 },
{ x: 9, y: 0.06 },
{ x: 10, y: -0.01 },
],
},
]}
band={0.31}
bandLabel="±1.96/√n"
format={{ kind: "number", decimals: 2, signed: true }}
height={320}
ariaLabel="Autocorrelation to lag 10"
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 `AutocorrelationChart` from Luc UI. It is: Check whether a model or a process is sane, from values you computed.
Import it with: import { AutocorrelationChart } 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="Autocorrelation to lag 10"`.
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
<AutocorrelationChart
series={[
{
key: "acf",
label: "ACF",
kind: "acf",
tone: "accent",
points: [
{ x: 1, y: 0.72 },
{ x: 2, y: 0.51 },
{ x: 3, y: 0.36 },
{ x: 4, y: 0.22 },
{ x: 5, y: 0.14 },
{ x: 6, y: 0.08 },
{ x: 7, y: -0.04 },
{ x: 8, y: -0.09 },
{ x: 9, y: 0.05 },
{ x: 10, y: 0.03 },
],
},
{
key: "pacf",
label: "PACF",
kind: "pacf",
tone: "neutral",
points: [
{ x: 1, y: 0.72 },
{ x: 2, y: 0.08 },
{ x: 3, y: -0.05 },
{ x: 4, y: 0.11 },
{ x: 5, y: 0.02 },
{ x: 6, y: -0.07 },
{ x: 7, y: 0.04 },
{ x: 8, y: -0.02 },
{ x: 9, y: 0.06 },
{ x: 10, y: -0.01 },
],
},
]}
band={0.31}
bandLabel="±1.96/√n"
format={{ kind: "number", decimals: 2, signed: true }}
height={320}
ariaLabel="Autocorrelation to lag 10"
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: Diagnostics, ML & risk
import { AutocorrelationChart } from "@luc/ui/charts";<AutocorrelationChart
series={[
{
key: "acf",
label: "ACF",
kind: "acf",
tone: "accent",
points: [
{ x: 1, y: 0.72 },
{ x: 2, y: 0.51 },
{ x: 3, y: 0.36 },
{ x: 4, y: 0.22 },
{ x: 5, y: 0.14 },
{ x: 6, y: 0.08 },
{ x: 7, y: -0.04 },
{ x: 8, y: -0.09 },
{ x: 9, y: 0.05 },
{ x: 10, y: 0.03 },
],
},
{
key: "pacf",
label: "PACF",
kind: "pacf",
tone: "neutral",
points: [
{ x: 1, y: 0.72 },
{ x: 2, y: 0.08 },
{ x: 3, y: -0.05 },
{ x: 4, y: 0.11 },
{ x: 5, y: 0.02 },
{ x: 6, y: -0.07 },
{ x: 7, y: 0.04 },
{ x: 8, y: -0.02 },
{ x: 9, y: 0.06 },
{ x: 10, y: -0.01 },
],
},
]}
band={0.31}
bandLabel="±1.96/√n"
format={{ kind: "number", decimals: 2, signed: true }}
height={320}
ariaLabel="Autocorrelation to lag 10"
/>Data contract
`series` contain lag points `{ x, y }` with a `kind` of ACF or PACF; `band` supplies the significance threshold and `bandLabel` names its derivation. The chart computes neither statistic.
Important configuration
Keep the lag axis ordered, show the significance band, and format coefficients with a signed precision that exposes small values.
Guidelines
When not to use
Do not infer a causal model from ACF/PACF patterns or use a band computed for a different sample size.
Configuration
| Export | Kind | Signature |
|---|---|---|
AutocorrelationChart | 14 documented props | ({ series, band, bandLabel, format, title, description, state, height, className, ariaLabel, ariaDescription, onReady, onEvent, eager, }: AutocorrelationChartProps) => import("@types/react").JSX.Elem… |
AutocorrelationChart props
Type: AutocorrelationChartProps
Values the compiler reads from the declaration.
| Prop | Type | Default | Notes |
|---|---|---|---|
ariaDescription? | string | undefined | — | |
ariaLabel? | string | undefined | — | |
band? | number | undefined | — | Half-width of the significance band, **supplied by the caller** — the usual value is `z / sqrt(n)` with the caller's own `z` and sample size. Omit to draw no band, which is the ho… |
bandLabel? | string | undefined | — | Label used for the band in the tooltip and the legend, e.g. "±1.96/√n". |
className? | string | undefined | — | |
description? | string | undefined | — | |
eager? | boolean | undefined | — | Create the engine on mount rather than when the surface is approached. |
format? | ChartFormat | undefined | — | |
height? | string | number | undefined | — | |
onEvent? | ((event: EChartEvent) => void) | undefined | — | |
onReady? | ((chart: EChartsInstance) => void) | undefined | — | |
series | readonly AutocorrelationSeries[] | — | |
state? | ChartState | 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
Diagnostics, ML & risk
The figures that answer “is this sane?” — all from values the caller computed.
Related