Skip to content
ChartslibraryUI
Get Pro

React ridgeline plot

The shape of a distribution for several groups, stacked to compare at a glance.

Get Pro to install · $79 once<RidgelinePlot />

A ridgeline plot draws the distribution of a value for each group as a smooth curve, stacked one above the other like a mountain range. You see more than a box plot shows: where most values sit, how wide the spread is, and whether there are two peaks, for example a fast lane and a slow lane.

The curves are kernel density estimates on a shared axis, so shapes can be compared directly, and each median is marked with a line. Sort by median to turn it into a ranking, and highlight the groups your title is about. The table gives the count, quartiles and median of every group.

With only a few values per group the curves are guesses, and the chart says so; use a strip plot there instead.

When to use

  • Deal size or order value by region
  • Response or delivery times by team
  • Salary or price bands by level

When not to use

  • Only the summary matters (median and spread) – use Box plot
  • A single group – use Histogram
  • Fewer than about 20 values per group – use Strip plot

Good practice

  • Sort by median when the groups have no natural order.
  • Use enough values per group (a few dozen or more).
  • Say the unit and the period in the subtitle.

Installation

Ridgeline plot is a Pro chart.

Installation is part of Pro

Get Pro to install it with your access key and the shadcn CLI, and use it in unlimited projects.

Unlock with Pro

Usage

Usage examples are part of Pro

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

Unlock with Pro

Data

One row per observation (long format) with a group key and a numeric value key.

[{ region: "EMEA", days: 34 }, { region: "EMEA", days: 41 }, ...]

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 RidgelinePlotProps extends FrameProps {
  /** One row per observation (long format). See the Data section for the shape. */
  data: Row[];
  /** Key of the group each observation belongs to (one ridge per group). */
  group: string;
  /** Key of the numeric value. */
  value: string;
  /** Number format for the value axis. */
  format?: FormatInput;
  /** Group order. Default: order of first appearance. "median" sorts by median, highest first. */
  order?: "data" | "median";
  /** How much ridges overlap, 0 to 1. Default 0.5. */
  overlap?: number;
  /** Group names to draw in colour; the rest are grey. */
  highlight?: string | string[];
}
Pro

Box plot

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

Histogram

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

Strip plot

Every observation visible by group, with the median marked.

Sign in to ChartslibraryUI

New here? The same step creates your account.

Continue with Google
or

No password needed. Bought Pro? Use the email you paid with and your license is there. By signing in you agree to the Terms and Privacy policy.