Skip to content

Feature/multiple charts#85

Open
ryansoe wants to merge 3 commits intomainfrom
feature/multiple_charts
Open

Feature/multiple charts#85
ryansoe wants to merge 3 commits intomainfrom
feature/multiple_charts

Conversation

@ryansoe
Copy link
Copy Markdown
Collaborator

@ryansoe ryansoe commented Apr 23, 2026

Changes

What changes did you make? Include screenshots if applicable, or explain how to view the changes.

  • Added a chart switcher to the "Total Spending" card on the Home tab — a segmented pill control toggles between Pie, Line, and Bar.
  • When Line or Bar is active, a secondary 1M / 3M / 6M / 1Y pill appears for selecting the time range. The category color legend is now shown only for the Pie chart.
  • Restyled LineChart.tsx and BarChart.tsx to match the new Tamagui design system: YStack/AppText layout, theme tokens via useTheme() ($primary for line/bar fill, $textMuted for axes/labels), and the range total rendered in the same variant="title" fontSize="$7" style as the Pie chart's center number. Previously both charts used raw View/StyleSheet with hardcoded hex (#007AFF, #333, a pastel month palette).
  • Minor PieChart.tsx cleanups: replaced key={Math.random()} with a stable index key, fixed a non-existent $text theme key → $color, and tightened the data prop type.
  • Generalized the SegmentedControl primitive into a controlled generic (options/value/onValueChange) so it can back both the chart-type and range selectors. Updated its two existing callsites (WeeklySpendingSection, demo.tsx) to the new API.
  • Fixed a follow-up bug where the Line/Bar charts displayed the all-time category total under the chart — the total now sums only the currently-rendered points, so it reflects the selected time range.
Screenshot 2026-04-23 at 14 41 21 Screenshot 2026-04-23 at 14 41 15 Screenshot 2026-04-23 at 14 41 10

Testing

How did you confirm your changes work? (Automated tests, manual verification, etc.)

  • Manual verification on the Home tab:
    • Default: Pie renders with the category legend; range pill is hidden.
    • Switching to Line/Bar: range pill appears, legend hides, charts render in navy $primary, total updates to the sum for that range.
    • Cycling 1M → 3M → 6M → 1Y refetches and rerenders, and the displayed total changes accordingly.
    • Switching back to Pie: legend returns, range pill hides.

Tracking

Add your issue number below.

Resolves #

@ryansoe ryansoe mentioned this pull request Apr 29, 2026
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