Skip to content

Add SwiftCharts statistics overhaul (iOS 16+)#17

Open
AnthonyH93 wants to merge 1 commit into
mainfrom
feature/swiftcharts-statistics-overhaul
Open

Add SwiftCharts statistics overhaul (iOS 16+)#17
AnthonyH93 wants to merge 1 commit into
mainfrom
feature/swiftcharts-statistics-overhaul

Conversation

@AnthonyH93

Copy link
Copy Markdown
Owner

Summary

  • Replaces custom bar charts on the Statistics tab with SwiftCharts (iOS 16+), with the existing custom charts as a fallback for iOS 14/15
  • Adds three new full-screen chart views: Cycling Charts (bar chart with period picker + vs-last-period comparison), Activity Heatmap (calendar-style ride frequency/distance/time grid), and Speed Trend (per-ride line chart)
  • Period picker covers 1W / 1M / 3M / 6M / YTD / 1Y across all chart types; last-selected period and heatmap metric are persisted via @AppStorage

New files

  • Model/ChartPeriod.swift, Model/ChartDataPoint.swift
  • ViewModel/Statistics/StatisticsChartsViewModel.swift
  • View/Statistics/CyclingChartsDetailView.swift, CyclingBarChart.swift
  • View/Statistics/ActivityHeatmapDetailView.swift, ActivityHeatmapChart.swift
  • View/Statistics/SpeedTrendDetailView.swift, SpeedTrendChart.swift

Test plan

  • Build on iOS 16+ simulator → Statistics tab shows 3 new chart rows
  • Cycling Charts: period picker animates between all 6 periods, metric picker (Distance / Time / Routes) switches data, Δ% comparison strip updates
  • Activity Heatmap: metric picker (Routes / Distance / Time) changes heatmap colors, sqrt-scaled vibrancy, last metric persisted across navigation
  • Speed Trend: one point per ride, period filter narrows the range, dots hidden when > 20 rides
  • Simulate iOS 14/15 → legacy 3-row bar chart path works unchanged
  • Theme color applies to all chart components
  • Metric/imperial preference applies to distance and speed values

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant