Skip to content
ChartslibraryUI Get Pro

Box plot

Median, quartiles, whiskers and every outlier per group, with n printed.

When to use

  • Comparing distributions across groups
  • Response times by tier

When not to use

Good practice

  • Show points too when n is small.
  • Explain the box (middle half) and the whiskers for non-technical readers.

Installation

Box plot is a Pro chart.

Installation is part of Pro

The full source is included in the Pro download. Get Pro to install it with the CLI and use it in unlimited projects.

Unlock with Pro
Already have Pro?npx chartslibraryui add box-plot --from ./chartslibraryui-pro

Usage

Usage examples are part of Pro

Every example on this page comes with its code in the Pro download. The props and data shape below are public.

Unlock with Pro

Data

Long-format rows with a group key and a numeric value key.

[{ tier: "Standard", hours: 4.2 }, ...]

Missing values are null. Invalid values make the chart say what’s wrong instead of drawing a misleading picture. How charts handle bad data

Props

Every chart also accepts the shared frame props: title, subtitle, source, height, mode, toolbar. Common API

export interface BoxPlotProps extends FrameProps {
  /** Raw observations in long format. */
  data: Row[];
  group: string;
  value: string;
  format?: FormatInput;
  /** Whisker reach in IQRs. Default 1.5 (Tukey). Points beyond are drawn as outliers, never hidden. */
  whisker?: number;
  /** Show every observation as faint dots behind the box. Default false. */
  points?: boolean;
  zero?: boolean;
}

Strip plot

Every observation visible by group, with the median marked.

Histogram

The shape of one distribution, with automatic binning and a median marker.