Skip to main content

Bar chart

Vertical, horizontal and grouped bars with staggered entry.

Bar chart in the example app

Screenshot from the example app. Run it to try every option live.

Usage​

import { BarChart } from 'react-native-skia-chart';

<BarChart width={w} height={200} data={[4, 8, 6, 9, 3]} labels={['M','T','W','T','F']} radius={6} />

Props​

PropTypeDefaultNotes
datanumber[]—Single series.
colorstring'#00B894'
series{ data, color }[]—Grouped (or stacked with stacked).
stackedbooleanfalse
horizontalbooleanfalse
labelsstring[]—Category labels.
barWidthRationumber0.7
radiusnumber4Corner radius.
showGridbooleantrue
formatY(v) => string—
staggernumber0.4Fraction of the duration spread across bars.

All charts also accept the shared props: width, height, padding, style, backgroundColor, animation, font, effects and gradient.

Gradient​

<BarChart {...props} gradient={{ type: 'linear', colors: ['#7C5CFF', '#00D2D3'] } // top → bottom by default} />

GPU notes​

Each bar's height is a Reanimated value; rounded rects are drawn in one GPU pass. A linear gradient is evaluated across the whole chart, so bars of different heights sample different colours, a natural "heat" look.