Skip to content

BarChart

Vertical bars for your points. Monthly signups below are honest sample data, rendered as a static SVG with no tooltips. Only the vertical orientation is supported.

Monthly signups

Bar chart, 5 points, high May 92, low Jan 40Static vertical bar chart of Bar chart. Values read left to right.0255075100Jan: 40Feb: 55Mar: 48Apr: 70May: 92JanJanFebFebMarMarAprAprMayMay
<BarChart data={signups} />

With values

Pass showValues to print each value above its bar.

Quarterly revenue, 4 points, high Q4 210, low Q1 120Static vertical bar chart of Quarterly revenue. Values read left to right.0100200300Q1: 120Q2: 180Q3: 150Q4: 210Q1Q1Q2Q2Q3Q3Q4Q4120180150210
<BarChart label="Quarterly revenue" data={revenue} showValues />

Props

PropTypeDefaultDescription
dataArray<{ label: string; value: number }>-Bars in order, left to right.
widthnumber560viewBox width; the SVG scales to 100%.
heightnumber240viewBox height.
labelstring"Bar chart"Chart name; opens the auto-summary.
showValuesbooleanfalsePrint each value above its bar.
layout"vertical""vertical"Only orientation; vertical bars.
classstring-Style passthrough.

Static honesty

Static SVG, no tooltips; values appear in text only whenshowValues is set. Bars darken on hover via CSS only. X labels longer than 8 characters are truncated with the full text kept in a <title>. A zero baseline is clamped into the viewBox, so negative values (not shown in the demos) draw below it.

Accessibility