Skip to content
Launch price: Pro is $79 once →
ChartslibraryUI
By Killian Helf · Updated 2026-11-28

Slope Chart: What It Is, When to Use It and How to Build One in React

A slope chart compares values at two points in time for several items. Each item gets a line from its first value on a left axis to its second value on a right axis, so the slope shows the direction and size of the change and crossing lines show items that swapped rank. It's also called a slopegraph.

Edward Tufte popularized the form in the 1980s under the name "slopegraph". It has stayed popular because it answers two questions at once: how much did each item change, and did the order change?

What a slope chart is

A slope chart has five parts:

  1. Two vertical axes. The left axis is the first period, the right axis is the second. Both use the same scale.
  2. One line per item. It starts at the item's first value and ends at its second value.
  3. Labels at both ends. The item name and value on the left, the value (and often the name again) on the right.
  4. Period labels. "2024" and "2026", or "Before" and "After", above each axis.
  5. Emphasis. One or two highlighted lines in color, with the rest in grey.

The axes are often left without tick marks, because every endpoint is labeled.

When to use a slope chart

  • Market share then vs now. Which vendors gained share and which lost it, and who overtook whom.
  • Rankings across two periods. Product lines ranked by revenue last year and this year.
  • Before and after. Satisfaction score by team before and after a reorganization.
  • Two-point survey results. The share of respondents choosing each option in two waves of a survey.

Slope charts work best with about 3 to 10 items. With that many lines, each label has room and crossings are easy to follow.

When not to use a slope chart

  • More than about ten items. The lines turn into a tangle and the labels collide. Use a dot plot or a dumbbell chart, which keep one row per item.
  • More than two points in time. A slope chart throws away everything between the endpoints. With monthly data, use a line chart or small multiples.
  • The values are parts of a whole and you care about composition. Use a stacked bar or a mix-shift chart.
  • The change is small compared with the level. If every line is nearly flat, the chart says "nothing happened" without showing the differences. Plot the change itself with a diverging bar chart.
  • The two axes would need different units. Then it isn't a slope chart. Two separate charts are the honest choice.

How to read a slope chart

  1. Read the period labels. Know which side is "before".
  2. Look at the steepness. A steep line is a big change; a flat line is no change.
  3. Look at the direction. Upward lines increased, downward lines decreased.
  4. Look for crossings. Where two lines cross, the items swapped places.
  5. Read the end labels for exact values. The slope gives the shape; the labels give the numbers.

One caution: steepness depends on the vertical scale and the chart's width. Compare slopes within one chart, not across two charts drawn at different sizes.

Design rules for honest slope charts

Use the same scale on both axes. This is the rule that makes the chart honest. Two different scales turn it into a dual-axis chart, where any slope can be manufactured.

Zero is optional. A slope chart encodes values by position, not length. Starting the axis at zero often squashes the lines together; starting near the data range shows the change. Say what the range is, and don't stretch a tiny change into a cliff.

Label directly at both ends. Put the name and value next to each endpoint instead of in a legend. When labels would overlap, nudge them apart and keep a thin leader line to the point.

Highlight the story, grey the rest. Color one or two lines and draw the others in grey. If every line has its own color, the reader has to decode a legend.

Color by meaning when you don't highlight. Up in one color, down in another, with "favorable" defined for the measure (a fall in churn is good).

Keep it to two periods. Resist adding a middle axis. If the middle matters, it's a line chart.

Worked example: market share in two years

The figures below are invented for illustration. A company tracks its share of category revenue against four competitors in 2024 and 2026:

Vendor 2024 2026
Competitor A 24.1% 21.6%
Competitor B 18.3% 15.2%
Our product 14.2% 18.7%
Competitor C 9.5% 11.0%
Others 33.9% 33.5%

As a slope chart, "Our product" climbs from 14.2% to 18.7% and crosses Competitor B, which falls from 18.3% to 15.2%. Competitor A is still the leader but is sloping down. Others is nearly flat.

A title that states the finding: "We passed Competitor B and gained 4.5 points of share in two years". Highlight "Our product" and "Competitor B" in color, draw the rest in grey, and label every endpoint with its value.

The same data as a grouped bar chart would need ten bars and wouldn't show the crossing. As a table, the reader would have to work out both the change and the new order.

How to build one in React

The ChartslibraryUI slope chart is free (MIT). If your project uses the shadcn CLI, install it from the registry:

npx shadcn@latest add https://chartslibraryui.com/r/slope-chart.json

Or use the ChartslibraryUI CLI in any React project:

npx chartslibraryui add slope-chart

Both commands copy slope-chart.tsx and the shared core/ folder into components/charts/. Import the theme once in your root layout (import "@/components/charts/core/charts.css";), then use the chart:

import { SlopeChart } from "@/components/charts/slope-chart";

const share = [
  { vendor: "Competitor A", y2024: 0.241, y2026: 0.216 },
  { vendor: "Competitor B", y2024: 0.183, y2026: 0.152 },
  { vendor: "Our product", y2024: 0.142, y2026: 0.187 },
  { vendor: "Competitor C", y2024: 0.095, y2026: 0.11 },
];

export function MarketShare() {
  return (
    <SlopeChart
      title="We passed Competitor B and gained 4.5 points of share"
      subtitle="Share of category revenue (illustrative data)"
      data={share}
      label="vendor"
      from="y2024"
      to="y2026"
      fromLabel="2024"
      toLabel="2026"
      highlight={["Our product", "Competitor B"]}
      format={{ kind: "percent", decimals: 1 }}
    />
  );
}

Both ends are labeled with collision-free placement, so you can skip the axis. Without highlight, lines are colored by direction of change; pass favorable="down" for measures where a decrease is good. The axis doesn't include zero by default; set zero if you want it. See the slope chart component page for live variants and all props.

FAQ

What is the difference between a slope chart and a line chart? A line chart shows a value across many periods on a continuous time axis. A slope chart shows exactly two periods for several items, with labels at both ends. Use a slope chart when only the start and end matter.

What is the difference between a slope chart and a dumbbell chart? A dumbbell chart puts each item in its own row with two dots on one horizontal axis, which makes the size of each change easy to compare. A slope chart puts the two periods side by side, which makes rank changes and crossings visible.

Is a slopegraph the same as a slope chart? Yes. Slopegraph is the name Edward Tufte used; slope chart is the more common name in dashboard tools.

How many items can a slope chart show? About 3 to 10. Beyond that, labels collide and lines tangle. Highlight the few that matter or switch to a dot plot.

Should a slope chart start at zero? It doesn't have to, because values are encoded by position rather than bar length. Choose a range that shows the change without exaggerating it, and keep the same scale on both sides.

Try the free charts in your app

26 charts, MIT, one command each.