Skip to content

LineChart

A trend line through your points. Monthly signups below are honest sample data, rendered as a static SVG with no tooltips.

Monthly signups

Line chart, 12 points, high Dec 120, low Jan 30Static line chart of Line chart. Values read left to right.050100150Jan: 30Feb: 34Mar: 42Apr: 45May: 52Jun: 58Jul: 61Aug: 70Sep: 78Oct: 88Nov: 102Dec: 120JanJanFebFebMarMarAprAprMayMayJunJunJulJulAugAugSepSepOctOctNovNovDecDec
<LineChart data={signups} />

With values

Pass showValues to print each value next to its dot.

Weekly signups, 7 points, high Fri 30, low Mon 12Static line chart of Weekly signups. Values read left to right.0102030Mon: 12Tue: 18Wed: 15Thu: 22Fri: 30Sat: 28Sun: 20MonMonTueTueWedWedThuThuFriFriSatSatSunSun12181522302820
<LineChart label="Weekly signups" data={weekly} showValues />

Props

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

Static honesty

Static SVG, no tooltips; values appear in text only whenshowValues is set. 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