Skip to content
DocsChartsSlopeLast updated Nov 2, 2026

Slope

Before and after, one line per item. Sample data: store conversion by channel, September to October, email 4.1% to 5.2%.

Open in
Conversion by channel, September to OctoberStore conversion by channel: 4 of 5 channels improved, Email from 4.1% to 5.2%; Social fell from 2.2% to 1.9%.SEPOCT4.1%Email5.2%3.2%Search3.6%2.7%Direct3.1%2.2%Social1.9%1.6%Affiliate2.3%IMPROVEDDECLINED
Conversion by channel, September to October
ChannelSeptemberOctober
Email4.1%5.2%
Search3.2%3.6%
Direct2.7%3.1%
Social2.2%1.9%
Affiliate1.6%2.3%
Conversion by channel, September to OctoberStore conversion by channel: 4 of 5 channels improved, Email from 4.1% to 5.2%; Social fell from 2.2% to 1.9%.SEPOCT4.1%Email5.2%3.2%Search3.6%2.7%Direct3.1%2.2%Social1.9%1.6%Affiliate2.3%IMPROVEDDECLINED
Conversion by channel, September to October
ChannelSeptemberOctober
Email4.1%5.2%
Search3.2%3.6%
Direct2.7%3.1%
Social2.2%1.9%
Affiliate1.6%2.3%

Installation

  1. 1

    Set up the registry once

    This chart is free in Hearth and MIT licensed: no token. Add @chartory to components.json once (the URL alone, no headers), or skip this when another chart is already installed.

    Installation guide
  2. 2

    Add the chart

    One command adds the Slope component to your project.

    npx shadcn add @chartory/slope
  3. 3

    Use it

    Pass your rows. The props are the Figma properties.

    usage.tsx
    import { Slope }  from "@/components/chartory/slope"<Slope  data={channelConversion}  size="m"  legend/>

Props

<Slope>

Every prop but data is a Figma property with the same name and values.

PropTypeDefault
data: The chart's data. The tables below list every field.SlopeDataRequired
size: The size class. Each one is laid out again from the data."xs" | "s" | "m" | "l""m"
legend: Shows the legend row under the plot.booleantrue

SlopeData

The data prop: one object for the whole chart.

PropTypeDefault
left: The left side's label.stringRequired
right: The right side's label.stringRequired
min: The bottom of the value scale.numberRequired
max: The top of the value scale.numberRequired
fmt: Formats a value for its label.(v: number) => stringRequired
rows: One entry per row.SlopeRow[]Required

SlopeRow

One object per entry in rows.

PropTypeDefault
label: The name shown on the chart.stringRequired
a: The value on the left.numberRequired
b: The value on the right.numberRequired

The data as a JSON Schema: schemas/slope.json

Slope chart: a React and Figma chart in four sizes

What does a slope chart show?

A slope chart joins each item's value at two points in time with a straight line, so risers and fallers show by the angle. Use it for before and after comparisons such as conversion by channel this month against last month.

Chartory ships it as a Figma component and a React component with the same name. The code installs from the shadcn registry with one command and lands in your project as a file you own.

What is the Slope component?

It is one <Slope> component. Its props are the Figma properties with the same names and values, and the props table above lists them. The data is two values per item, at two points.

Sizes XS, S, M and L re-lay the chart out from the data instead of scaling it, so labels stay readable at every size.

When should I use it?

  • Are there exactly two points? Yes means the slope fits.
  • Is the change the point? Yes means the slope fits.
  • Is it a few items? Yes means the slope fits.

When does another type fit better?

  • More periods to follow. Use Bump chart instead.
  • Two values compared, not a change. Use Dumbbell instead.
  • Many items cross into a tangle. Use Diverging bars instead.

Slope chart questions

Installing, data, Figma and plans.

  • Yes. It installs through the shadcn registry with the shadcn CLI, and the file lands in your project.

Stay in the loop

New charts, by email.

Get an email when new chart types and releases ship.

Unsubscribe any time.