Phase 9d · Tier B
RN-universal Chart pilot
ScaffoldedThree lightweight chart primitives — bar, line, area. Cut to the most-needed types per the 9a inventory. Pure RN — no SVG, no Skia. ~470 LOC of View + absolute positioning.
Bar chart — side-by-side
Two series rendered as paired bars per category.
Revenue
Expenses
Jan
Feb
Mar
Apr
May
Jun
Bar chart — stacked
Same data, stacked so each bar shows the total height.
Online
Bank
W1
W2
W3
W4
W5
W6
Line chart
Connect-the-dots line chart. Two series.
Revenue
Expenses
Jan
Feb
Mar
Apr
May
Jun
Area chart
Same data set rendered as an area chart with translucent fill.
Online
Bank
W1
W2
W3
W4
W5
W6
Library decision
Per Phase 9 Q2, every Tier B primitive must record its library choice. RnChart ships with no new runtime dependency.
- recharts (~7 M/wk, MIT) — shadcn's choice; web-only (DOM SVG + DOM event handlers).
- victory-native@41.20.2 (~355 k/wk, MIT) — 9a inventory's recommendation. Pulls
react-native-skiapeer dep (~3 MB unpacked). Same blocker asreact-native-reanimated(rejected for RnSlider) andexpo-document-picker(rejected for RnFileUpload). - react-native-svg (~3 M/wk, MIT) — peer dep for any real charting. Same blocker.
- react-native-chart-kit (~120 k/wk, MIT) — wraps react-native-svg. Same blocker.
- This implementation — pure RN core.
View+ absolute positioning + percentage heights/widths. Line segments via thinViews rotated to angles. No SVG, no Skia.
Semantics
| Aspect | shadcn (recharts) | RN | Notes |
|---|---|---|---|
| Bar (side-by-side) | BarChart + Bar | RnBarChart yKeys=[a,b] | Same default |
| Bar (stacked) | Bar stackId | RnBarChart stacked | Boolean prop |
| Line | LineChart + Line | RnLineChart yKeys=[a,b] | Straight segments only |
| Area | AreaChart + Area | RnAreaChart | Per-segment rectangular fill (approximation) |
| Pie / donut | PieChart | — (deferred) | 0.3.x candidate |
| Tooltip | ChartTooltip / Recharts.Tooltip | — (deferred) | 0.3.x candidate |
| Legend | auto from config | auto from config | Same |
| Y-axis ticks | YAxis component | — (deferred) | X-axis labels only in v1 |