React Native Line Chart for Expo
Multi-series lines with four curve types, dot styles, glow, dashed targets, animated dashes, a projected last segment, gaps for missing data, goal lines and a y axis that can fit the data (stock-style).
Also known as: line graph, interactive line chart.
Live — the real React Native component rendered with react-native-web. Tap, drag and scrub it.
Installation
npx expo install expo-charts react-native-svgUsage
Import the component and pass your data. Width defaults to the parent, so it adapts to phones, tablets and rotation.
Like this? There's a lot more in Pro Pro
12 full screens built from the same kit — install them the same way.
Props
| Prop | Type | Default |
|---|---|---|
| curve Interpolation. | "monotone" | "natural" | "linear" | "step" | "monotone" |
| strokeWidth Line thickness. | number | 2 |
| strokeVariant Stroke style; animated dashes march. | "solid" | "dashed" | "animated-dashed" | "solid" |
| glow Soft neon glow under the stroke. | boolean | false |
| showDots Point markers. | boolean | line: true |
| dotVariant Point marker style. | "default" | "border" | "colored-border" | "none" | "default" |
| activeDotVariant Marker at the scrubbed point. | DotVariant | "default" |
| bufferLast Draws the last segment dashed (projection). | boolean | false |
| dashedKeys Keys drawn dashed. | string[] | [] |
Shared cartesian props
Every Area, Bar, Line and Combo chart also accepts these — this is where axes, grid, legend, tooltip, brush and loading live.
| Prop | Type | Default |
|---|---|---|
| data Rows, e.g. [{ month: "Jan", desktop: 186 }]. | Datum[] | — |
| config Series keys → { label, color, variant, strokeVariant, glow }. | ChartConfig | — |
| xKey Key of the category / x value in each row. | string | — |
| keys Subset and order of series to draw. | string[] | all config keys |
| width Omit to fill the parent and re-flow on rotation. | number | parent width |
| height Chart height in points. | number | 220 |
| showGrid Horizontal grid lines. | boolean | true |
| gridStyle Grid line style. | "solid" | "dashed" | "solid" |
| gridVertical Vertical grid lines at categories. | boolean | false |
| showXAxis Category labels under the chart. | boolean | true |
| showYAxis Value ticks. | boolean | false |
| yAxisPosition Side for the value axis. | "left" | "right" | "left" |
| yTickCount Approximate number of ticks. | number | 4 |
| yDomain Y range. ["auto", "auto"] fits the data (prices, heart rate, weight). | [number | "auto", number | "auto"] | starts at 0 |
| referenceLines Goal / limit / average lines across the plot. | { value, label?, color?, dashed? }[] | [] |
| connectNulls Missing values (null, NaN) leave a gap; true draws across them. | boolean | false |
| backgroundVariant dots, grid, cross-hatch, diagonal-lines, plus, tiny-checkers, wiggle-lines, bubbles. | BackgroundVariant | "none" |
| showLegend Legend under (or above) the chart. | boolean | false |
| legendVariant square, circle, circle-outline, rounded-square, rounded-square-outline, vertical-bar, horizontal-bar. | LegendVariant | "rounded-square" |
| legendPosition Where the legend sits. | "top" | "bottom" | "bottom" |
| legendAlign Legend alignment. | "left" | "center" | "right" | "center" |
| legendMode Tap to hide a series, or highlight it and dim the rest. | "toggle" | "select" | "none" | "toggle" |
| showTooltip Floating tooltip while scrubbing / after a tap. | boolean | true |
| tooltipIndicator Colour marker in tooltip rows. | "dot" | "line" | "dashed" | "dot" |
| tooltipVariant Tooltip surface. | "default" | "frosted-glass" | "default" |
| tooltipRoundness Tooltip corner radius. | "sm" | "md" | "lg" | "xl" | "lg" |
| showTooltipTotal Adds a Total row. | boolean | false |
| showLabels Value labels on points / bars. | boolean | false |
| animationType rise, left-to-right, right-to-left, center-out, edges-in, none. | AnimationType | "left-to-right" (bars: "rise") |
| isLoading Pulsing skeleton with a Loading badge. | boolean | false |
| showBrush Range selector under the chart for long series. | boolean | false |
| formatValue Formats values in axes, labels and tooltip. | (v, key) => string | compact (1.2k) |
| formatLabel Formats category labels. | (x, index) => string | String(x) |
| onSelect Fires while scrubbing, on tap and on VoiceOver swipes. | (index, datum) => void | — |
| activeIndex Controlled selection shown while the finger is up: the latest value, or a synced chart's point. | number | null | — |
| emptyText Shown when data is empty. | string | "No data" |
| accessibilityLabel VoiceOver / TalkBack label. Swipe up / down reads each point. | string | generated summary |
| onScrubStart / onScrubEnd Pause your ScrollView while the finger scrubs. | () => void | — |
FAQ
How do I make a line chart in React Native?
npx expo install expo-charts react-native-svg) and render <LineSeriesChart data={…} />. It's animated and touchable, and works on iOS, Android, web and in Expo Go.Does Line Chart work in Expo Go?
react-native-svg, which Expo Go includes, so it runs on iOS and Android with no development build.Is Line Chart free?
expo-charts, which is free and MIT-licensed.