Skip to content

Add statistics page with time-period revenue charts and cumulative revenue line#12

Open
IanTheMitten wants to merge 2 commits into
mainfrom
codex/add-timeperiodrevenuebarchart-and-timeperiodcumulativeline
Open

Add statistics page with time-period revenue charts and cumulative revenue line#12
IanTheMitten wants to merge 2 commits into
mainfrom
codex/add-timeperiodrevenuebarchart-and-timeperiodcumulativeline

Conversation

@IanTheMitten

Copy link
Copy Markdown
Owner

Motivation

  • Provide a dedicated statistics view to inspect revenue patterns by canonical time periods and visualize cumulative revenue over sampled sales within a selected period.
  • Surface weekday-focused averages and a running total so staff can identify busy windows and revenue trends across days.

Description

  • Added a new StatisticPage component at src/components/budget/StatisticPage.tsx that filters transactions by date range and composes two visualizations.
  • Implemented TimePeriodRevenueBarChart in src/components/budget/TimePeriodRevenueBarChart.tsx with CANONICAL_PERIODS, getCanonicalPeriodForDate, per-period average revenue calculation (weekdays only), selectable bars, and configurable coloring.
  • Implemented TimePeriodCumulativeLine in src/components/budget/TimePeriodCumulativeLine.tsx that samples transactions for the selected canonical period, excludes weekends, and renders a cumulative revenue line chart.
  • Wire up navigation and routing: updated TopBar (src/components/TopBar.tsx) to include a new statistics nav item and adjusted its props/types; updated App.tsx to include the statistics page state, import the StatisticPage, and render it when selected.
  • Charts use recharts and the existing CurrencyContext formatting for tooltips and labels.

Testing

  • No automated tests were run on this change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant