Chart
Native SwiftUI data visualization supporting line, area, bar, and heatmap charts with zero third-party charting libraries.
Signature#
SIGNATURE
<Chart
kind="area"
values={[12, 19, 15, 28, 34, 29, 41]}
labels={["M","T","W","T","F","S","S"]}
color="theme.accent"
height={84}
/>
kind="area" · 7 points
MTWTFSS
Props#
kindstringRequired- Chart type:
"line","area","bar", or"heatmap". valuesnumber[]Required- Numeric data series (plugs directly into
useHostData("system").cpuHistoryor fetched API arrays). labelsstring[]Optional- Axis labels corresponding to
values. colorstringDefault "theme.accent"- Primary stroke, bar, or peak-intensity heatmap color.
secondaryColorstringOptional- Secondary gradient or accent tone.
minValuenumberOptional- Fixed lower Y-axis bound (auto-scaled when omitted).
maxValuenumberOptional- Fixed upper Y-axis bound (e.g.
minValue={0} maxValue={100}for percentages). showBaselinebooleanDefault false- Draws a subtle baseline rule.
columnsnumberOptional- For
kind="heatmap": grid column count (e.g.7for a weekly activity matrix).
Example: Bar Chart & Heatmap#
TSX
<Chart
kind="bar"
values={[2.4, 3.8, 1.9, 4.5, 3.2, 5.1, 4]}
labels={["M","T","W","T","F","S","S"]}
color="theme.accent"
showBaseline={true}
/>
<Chart
kind="heatmap"
values={HEAT_28_DAYS}
columns={7}
color="theme.success"
/>
kind="bar" & kind="heatmap"