Box Plot

How values spread in each category — quartiles, median, whiskers and outliers, several series side by side. Drawn as SVG by the component, rendered on the server and themed by the design tokens.

Part of @tectra-ng/charts (npm install @tectra-ng/charts, also included in tectra-ng).

Features10APIThemingAccessibility

Basic

Give raw values and the chart computes the box (first to third quartile), the median, whiskers to the last values within 1.5 × IQR and the outliers beyond them.

Arrow keys move between values
Response time by service. Box plot, 1 series, 5 values
CategoryMinFirst quartileMedianThird quartileMax
Auth99111119129139
Search169200.75215.5228260
Checkout266315.75338354.25400
Profile8190.759498108
Reports425503.75535.5570.75635

Grouped

Several series stand side by side in each category; the legend hides one and the others take its place.

Arrow keys move between values
Deal size by region. Box plot, 2 series, 4 values
CategoryMinFirst quartileMedianThird quartileMax
Europe, Q135.2K39.5K43K43.9K47.5K
Europe, Q240.6K44K45.5K47.8K52.2K
Europe, Q342.4K48.2K52.4K54.3K57.8K
Europe, Q442.3K46.2K48K50K54.7K
Americas, Q131.3K36K38.9K40.5K45.9K
Americas, Q231.7K38.9K41K45.2K50.6K
Americas, Q332K40.2K45.2K48.1K54.4K
Americas, Q442.5K49.8K52.2K56.7K65K

Stats

When the numbers are already known, pass { min, q1, median, q3, max, outliers }. showOutliers hides the outliers.

Arrow keys move between values
Test scores by grade. Box plot, 1 series, 3 values
CategoryMinFirst quartileMedianThird quartileMax
Grade 54158677694
Grade 64561707997
Grade 73855668199

Events

boxClick reports the clicked box with its category and the five numbers.

Arrow keys move between values
Click a part. Box plot, 1 series, 3 values
CategoryMinFirst quartileMedianThird quartileMax
A46.758.511.2512
B2345.57
C8111316.522

Click the chart.

Loading and empty

loading keeps the size with a skeleton; empty series show "No data".

No data

Live

New series redraw in place — boxes move to their new quartiles.

Arrow keys move between values
Shuffled data. Box plot, 1 series, 3 values
CategoryMinFirst quartileMedianThird quartileMax
A2933.7539.545.2551
B4449.7554.560.2566
C3742.7548.553.2559

Accessibility

Tab to the chart: ←/→ walk the categories, ↑/↓ the series, and each box is announced with its five numbers. Screen readers also get a summary and a hidden table.

Arrow keys move between values
Lead time by team, days. Box plot, 1 series, 3 values
CategoryMinFirst quartileMedianThird quartileMax
Core45678
Web44444
Mobile7891012

Design tokens

dt sets the box width, radius and fill, the line widths, the whisker caps, the outliers and the palette of one chart.

Arrow keys move between values
Custom boxes. Box plot, 1 series, 3 values
CategoryMinFirst quartileMedianThird quartileMax
A4144505459
B5356.7559.56269
C3141.7545.55260

Pass through

pt reaches the parts — box, median, whisker, outlier, grid, axis, legend, plot, tooltip and more.

Arrow keys move between values
Dashed whiskers. Box plot, 1 series, 2 values
CategoryMinFirst quartileMedianThird quartileMax
North6266.7570.57682
South4650.755559.2565

Unstyled

unstyled removes the tectra styles: no tokens, no rounding, no motion — the geometry, the colours, the tooltip and the keyboard stay, ready for your own CSS.

Arrow keys move between values
Unstyled chart. Box plot, 1 series, 2 values
CategoryMinFirst quartileMedianThird quartileMax
A1718.25202125
B2325272729