Mobile › Display
BarChart
Vertical bars for a few periods, such as days or months. Tap a bar to read its value.
Installation
npx expo install plankui-mobile react-native-safe-area-context expo-hapticsUsage
import { BarChart } from "plankui-mobile";
<BarChart data={[{ label: "Mon", value: 6120 }, { label: "Tue", value: 8410 }, { label: "Wed", value: 4300 }]} />API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| data | { label: string; value: number }[] | One bar each; up to about 12 fit a phone. | |
| height | number | 160 | Height of the bars in points. |
| format | (n: number) => string | toLocaleString | Formats the value shown above. |
| defaultSelected | number | the last | The bar picked at first. |
| accessibilityLabel | string | "Bar chart" | What the chart shows. |