Examples
Radial chart Pro
Progress toward goals as concentric rings, like Apple's activity rings. Each row is a ring, outermost first, filled to its share of max over a faint track. Give every ring the same max, or name a row field that holds each ring's own goal. Rings fill from empty on mount and glide to new values as the day goes on.
import { RadialChart } from '@patine-ui/pro';
Live data
Loading…
<View style={{ width: 340, gap: 8 }}> <Button size="sm" variant="outline" onPress={() => setData(roll())} style={{ alignSelf: 'flex-end' }}>Next day</Button> <RadialChart data={data} nameKey="ring" valueKey="value" max="goal" centerLabel="Move" series={[{ key: 'Move', color: '#E11D48' }, { key: 'Exercise', color: '#16A34A' }, { key: 'Stand', color: '#0891B2' }]} accessibilityLabel="Today's activity" height={220} /> </View>
Try the props
centerLabeldesign<RadialChart
data={rings}
nameKey="ring"
valueKey="kcal"
max="goal"
/>
Example: savings goals
A banking app's goals: each ring is how far a goal has come against its own target, so a small goal nearly done and a big one just started read fairly side by side.
Loading…
<View style={{ width: '100%', maxWidth: 520, flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center', gap: 16 }}> <RadialChart data={GOALS} nameKey="goal" valueKey="saved" max="target" centerLabel="Holiday" series={GOALS.map((g) => ({ key: g.goal, color: g.color }))} height={220} accessibilityLabel="Savings goals" style={{ flex: 1, minWidth: 220 }} /> <VStack gap="sm" style={{ flex: 1, minWidth: 200 }}> {GOALS.map((g) => ( <HStack key={g.goal} justify="space-between"> <Text>{g.goal}</Text> <Text color="textSecondary">€{g.saved.toLocaleString()} of €{g.target.toLocaleString()}</Text> </HStack> ))} </VStack> </View>
Fixed goals
Loading…
<RadialChart data={data} nameKey="ring" valueKey="value" max="goal" centerLabel="Move" series={[{ key: 'Move', color: '#E11D48' }, { key: 'Exercise', color: '#16A34A' }, { key: 'Stand', color: '#0891B2' }]} accessibilityLabel="Today's activity" height={220} style={{ width: 320 }} />
Props
The shared chart props, and:
| Prop | Type | Default | Description |
|---|---|---|---|
nameKey | string | — | The row field naming each ring. |
valueKey | string | — | The row field with each ring's value. |
max | number | string | 100 | A full ring: one number, or a row field with each ring's goal. |
series | { key, label?, color? }[] | — | Labels and colours, matched to nameKey. |
centerLabel | string | — | Shows the first ring's share in the middle, with this under it. |