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-haptics

Usage

import { Sparkline } from "plankui-mobile";

<Sparkline data={[8, 9, 7, 11, 12, 10, 14, 13, 16, 18]} trend />

API reference

PropTypeDefaultDescription
datanumber[]The values, oldest first.
heightnumber40Height in points.
trendbooleanfalseGreen when the last value is above the first, red when below.
colorstringthe accentLine colour, when trend is off.
thicknessnumber2Line thickness.
accessibilityLabelstringthe trendRead out instead of the default "Trend up, from 8 to 18".