Mobile › Display
Sparkline
A tiny line chart with no axes, for a trend beside a number. Fills the width it is given.
Installation
npx expo install plankui-mobile react-native-safe-area-context expo-hapticsUsage
import { Sparkline } from "plankui-mobile";
<Sparkline data={[8, 9, 7, 11, 12, 10, 14, 13, 16, 18]} trend />API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| data | number[] | The values, oldest first. | |
| height | number | 40 | Height in points. |
| trend | boolean | false | Green when the last value is above the first, red when below. |
| color | string | the accent | Line colour, when trend is off. |
| thickness | number | 2 | Line thickness. |
| accessibilityLabel | string | the trend | Read out instead of the default "Trend up, from 8 to 18". |