Skip to content
StatisticalGenerated from the public API

QqPlotChart

See the distribution, the agreement or the uncertainty in the values you supply.

@luc/ui/charts

What it shows

Check whether a sample follows a reference distribution by comparing ordered sample quantiles with theoretical quantiles.

Live preview

Sample quantiles against theoretical normal quantiles; the curve leaves the 45° line in both tails.

<QqPlotChart
  points={[
    { x: -1.73, y: -2.05 },
    { x: -1.15, y: -1.31 },
    { x: -0.79, y: -0.86 },
    { x: -0.51, y: -0.58 },
    { x: -0.27, y: -0.24 },
    { x: -0.05, y: -0.02 },
    { x: 0.16, y: 0.19 },
    { x: 0.38, y: 0.36 },
    { x: 0.62, y: 0.71 },
    { x: 0.9, y: 0.98 },
    { x: 1.27, y: 1.44 },
    { x: 1.86, y: 2.22 },
  ]}
  height={320}
  ariaLabel="Normal quantile plot"
/>

Controls

Height

320px

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 { QqPlotChart } from "@luc/ui/charts";

<QqPlotChart
  points={[
    { x: -1.73, y: -2.05 },
    { x: -1.15, y: -1.31 },
    { x: -0.79, y: -0.86 },
    { x: -0.51, y: -0.58 },
    { x: -0.27, y: -0.24 },
    { x: -0.05, y: -0.02 },
    { x: 0.16, y: 0.19 },
    { x: 0.38, y: 0.36 },
    { x: 0.62, y: 0.71 },
    { x: 0.9, y: 0.98 },
    { x: 1.27, y: 1.44 },
    { x: 1.86, y: 2.22 },
  ]}
  height={320}
  ariaLabel="Normal quantile plot"
  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 `QqPlotChart` from Luc UI. It is: See the distribution, the agreement or the uncertainty in the values you supply.

Import it with: import { QqPlotChart } 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="Normal quantile plot"`.

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
<QqPlotChart
  points={[
    { x: -1.73, y: -2.05 },
    { x: -1.15, y: -1.31 },
    { x: -0.79, y: -0.86 },
    { x: -0.51, y: -0.58 },
    { x: -0.27, y: -0.24 },
    { x: -0.05, y: -0.02 },
    { x: 0.16, y: 0.19 },
    { x: 0.38, y: 0.36 },
    { x: 0.62, y: 0.71 },
    { x: 0.9, y: 0.98 },
    { x: 1.27, y: 1.44 },
    { x: 1.86, y: 2.22 },
  ]}
  height={320}
  ariaLabel="Normal quantile plot"
  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: Statistical

import { QqPlotChart } from "@luc/ui/charts";
<QqPlotChart
  points={[
    { x: -1.73, y: -2.05 },
    { x: -1.15, y: -1.31 },
    { x: -0.79, y: -0.86 },
    { x: -0.51, y: -0.58 },
    { x: -0.27, y: -0.24 },
    { x: -0.05, y: -0.02 },
    { x: 0.16, y: 0.19 },
    { x: 0.38, y: 0.36 },
    { x: 0.62, y: 0.71 },
    { x: 0.9, y: 0.98 },
    { x: 1.27, y: 1.44 },
    { x: 1.86, y: 2.22 },
  ]}
  height={320}
  ariaLabel="Normal quantile plot"
/>

Data contract

`points` is an ordered array of `{ x, y }` pairs: theoretical quantile on x and sample quantile on y. The caller chooses and computes the reference distribution.

Important configuration

Keep both axes on the same numeric scale, add the relevant reference line in the surrounding analysis, and preserve point order.

Guidelines

When not to use

Do not use a Q–Q plot as proof of normality; a short or heavy tail is a visual diagnosis that needs the sample and method.

Configuration

Exported symbols
ExportKindSignature
QqPlotChart14 documented props({ points, labels, xFormat, yFormat, title, description, state, height, className, ariaLabel, ariaDescription, onReady, onEvent, eager, }: QqPlotChartProps) => import("@types/react").JSX.Element

QqPlotChart props

Type: QqPlotChartProps

Values the compiler reads from the declaration.

QqPlotChart props
PropTypeDefaultNotes
ariaDescription?string | undefined—
ariaLabel?string | undefined—
className?string | undefined—
description?string | undefined—
eager?boolean | undefined—Create the engine on mount rather than when the surface is approached.
height?string | number | undefined—
labels?{ x?: string; y?: string; } | undefined—
onEvent?((event: EChartEvent) => void) | undefined—
onReady?((chart: EChartsInstance) => void) | undefined—
pointsreadonly XYPoint[]—Theoretical quantile against the sample quantile, paired.
state?ChartState | undefined—
title?string | undefined—
xFormat?ChartFormat | undefined—
yFormat?ChartFormat | 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.

Luc UI v1.0QqPlotChartdark theme