Skip to content
InsightCharts

Search

Search guides and components

Arrow chart

Draws an arrow per category from a start value to an end value, showing the direction and size of each shift.

Use when
Shifts between two moments across up to about 25 categories when some rise and some fall: swings between elections, before / after a policy.
Avoid when
When both levels matter more than the direction (use dumbbell chart); more than two points in time (use slope chart or line chart); a single value per category (use bar chart).

Preview

Support among under-30s rose from 62% in 2019 to 71% in 2024

Share in favour of the congestion charge, by age group, 2019 to 2024

Source: City residents survey · Illustrative figures.

Composition

Used in

No molecule or template lists arrow chart in its composes. It still fits any slot that takes a component.

Installation

$ pnpm dlx shadcn@latest add @insightcharts/arrow-chart

The CLI copies the source into your project and needs the @insightcharts registry in components.json; see installation. With the package, import it by name:

import { ArrowChart } from "insightcharts";

Examples

Lower is better, one row highlighted

Greek unemployment fell from 27.5% in 2013 to 10.1% in 2024

Unemployment rate, 2013 to 2024

Source: Eurostat (rounded) · Figures are approximate, for illustration

Long format

The Greens' vote share fell from 20.5% in 2019 to 11.9% in 2024

Vote share in the European Parliament election, Germany, 2019 to 2024

Source: Federal Returning Officer · Figures are approximate, for illustration

Stress: 24 rows on a value axis

The winning party's vote share in Lincolnshire rose from 20% to 38%

Vote share of the winning party, by region

Illustrative figures.

Props

PropTypeDefaultDescription
categoryrequiredstringCategory field: one arrow each.
fromrequiredstringField with the start value, or (long data) the series value that marks it.
torequiredstringField with the end value, or (long data) the series value that marks it.
seriesstringLong data: the field whose values are from and to.
valuestring"value"Long data: the measure field.
good"up" | "down" | "none""up"Direction drawn in the positive colour. none uses the accent for every arrow.
sort"change" | "from" | "to" | "none""change"Row order.
order"desc" | "asc""desc"Sort direction.
labelsbooleanStart and end values at the tail and head. Default: on for up to 14 rows; otherwise a value axis is drawn.
changeLabelboolean | stringfalsePrint the signed change in a right-hand column; a string sets the column header.
zerobooleanfalseStart the value axis at zero.
namesRecord<string, string>Display names for the from and to keys.
Common chart props 29

Every chart built with defineChart accepts these on top of its own props.

PropTypeDescription
dataDataInputRows, CSV text, a URL, { url, path }, an async function, or an Arrow-style table. Omit inside <InsightData>.
transformTransform | Transform[]A pipeline of transforms applied before drawing.
titlestringThe title. One plain statement of what the data shows, with the number and the period ("Monthly churn fell from 4.2% to 2.1% in 2024"), or a plain label ("Monthly churn, 2024"). One clause, no figures of speech.
subtitlestringMeasure, unit, population, period.
sourcestringData source, shown as "Source: ...".
notestringMethod notes or caveats.
heightnumber | stringCSS height of the plot. Default 360.
aspectnumberWidth / height. Overrides height.
highlightstring | string[]The entity (or entities) the title is about. Every other series is drawn in grey.
annotationsAnnotation[]Reference lines, shaded bands and callouts, in data coordinates.
formatFormatSpecHow to print values: "compact", "percent", "currency:USD", "{value} kg", Intl options, or a function.
legendbooleanShow the legend. Default: shown when there are two or more series.
selectboolean | stringMake marks clickable to filter. Inside <InsightData> the selection filters every other chart. Pass a field name, or true to use the chart's category field.
onSelect(values: string[], field: string) => voidCalled with the selected values whenever the selection changes.
optionEChartsOption | ((option: EChartsOption, ctx: BuildContext) => EChartsOption)Deep-merged over the generated ECharts option, or a function that receives and returns it. Use it for ECharts settings no prop covers.
themeThemeInputA theme, or a partial set of tokens merged over the surrounding theme, for this chart only.
modeModeInput"auto" (default) follows the page, "system" follows the OS, or force "light" / "dark".
rendererRendererInput"auto" (default) uses SVG for light charts and canvas for heavy ones.
animatebooleanSet false to disable animation. Reduced-motion preferences are always respected.
lazybooleanMount the chart only when it scrolls near the viewport. Default true.
groupstringLink tooltips with other charts sharing this group id.
exportableboolean | ExportFormat[]Show an export menu: true or a list of formats from png, jpeg, svg, pdf, csv, json.
tablebooleanShow a collapsible "View data" table under the chart.
altstringAccessible description: the chart type and measures, then the main pattern and the notable values.
idstringStable id for this chart's selection in the shared store.
onEventsRecord<string, ChartEventHandler>ECharts event handlers, e.g. { click: (params, chart) => {} }. Prefix a name with zr: to bind to the canvas itself.
onReady(chart: EChartsInstance) => voidCalled with the ECharts instance once it is created.
classNamestringClass name for the outer <figure>.
styleCSSPropertiesInline style for the outer <figure>.