| name | battery-chart |
| description | Builds and renders battery history charts in SwiftUI using Swift Charts. Use when implementing rolling history storage, sampling cadence, and trend visualization for battery percentage. |
Battery Chart Skill
Goal
Render a stable, readable charge trend graph.
Steps
- Append sampled snapshots into a rolling history window.
- Keep history bounded by age and sample count.
- Plot percentage over time with
Swift Charts.
- Surface the selected time range (for example, last 6 hours).
- Handle sparse data gracefully (empty and low-sample states).
Validation Checklist
- No crashes with empty history.
- Graph updates after each refresh tick.
- Percent axis stays in expected range (0-100).