Boxplot
Box-and-whisker plot with five-number summary and outlier dots per series.
Category: chart · WCAG 2.1-AA · chart, boxplot, box-whisker, statistics, data-viz
Props
| Prop | Type | Default | Description |
|---|---|---|---|
series | { id: string; label: string; values: number[] }[] | — | Array of series each with raw numeric values |
title | string | — | Title text for the component. |
description | string | — | Supporting description text. |
width | number | — | Fixed SVG width in px. ⚠ **Omit for a responsive chart** — the chart fills and tracks its container via a ResizeObserver; there is no correct pixel number in a responsive grid. A fixed width is clamped to the container (max-inline-size: 100%) so it can never overflow its card, but it also stops the chart growing. `useChartSize` is NOT needed for this — charts call it internally. |
height | number | 320 | SVG height in px. Unlike `width`, height does NOT track the container — this is the knob you set to change the chart's aspect. |
className | string | — | Additional CSS class names merged onto the root element. |
plain | boolean | false | Marks only — no axes, grid lines, or legend. For micro/inline charts. |
Design tokens
--cascivo-chart-1--cascivo-chart-2--cascivo-chart-3--cascivo-chart-4--cascivo-chart-5--cascivo-chart-6--cascivo-chart-7--cascivo-chart-8
When to use
- Comparing the distribution spread, median, and quartiles across groups
- Surfacing outliers and skew in statistical data
When not to use
- Showing the full shape of a single distribution — use Histogram
- Comparing single aggregate values — use BarChart
Examples
Basic boxplot
import { Boxplot } from '@cascivo/charts'
const series = [
{ id: 'a', label: 'Group A', values: [1,2,3,4,5,6,7,8,9,10] },
{ id: 'b', label: 'Group B', values: [3,5,6,7,8,8,9,9,10,15] },
]
<Boxplot series={series} title="Comparison" />