View Activity Type Distribution Donut Chart
The activity type donut chart must display each configured activity type as a colored segment, with a legend listing type names and their percentage shares. The chart must use the organization's configured activity type labels (pulled from the org-labels system) so the terminology matches what coordinators and peer mentors see everywhere else in the app. Tapping a segment filters the peer mentor stats list below to show only activities of that type. The chart must be built using fl_chart via the fl-chart-adapter and meet WCAG 2.2 AA contrast requirements for all segment colors.
User Story
Acceptance Criteria
- Given the coordinator views the statistics screen, When the donut chart renders, Then each activity type in the selected period is shown as a segment with a percentage label
- Given the organization uses custom activity type labels, When the chart legend renders, Then labels match the organization's configured terminology not generic defaults
- Given the coordinator taps a donut segment, When the filter applies, Then the peer mentor stats list below updates to show only activities of the tapped type
- Given WCAG 2.2 AA is required, When chart colors are applied, Then all segment colors meet a minimum contrast ratio of 3:1 against the chart background
- Given no activities exist for a type in the selected period, When the chart renders, Then that type is either omitted or shown as a zero-width segment with a note in the legend
Business Value
Bufdir reporting requires activities to be categorized by type. A coordinator who can see at a glance that 90% of activities are phone calls and almost no home visits are being registered can coach their team accordingly before the reporting deadline. This chart bridges day-to-day operational oversight with annual grant compliance requirements.
Components
- Activity Type Donut Chart ui
- fl_chart Adapter infrastructure
- Coordinator Statistics Service service
- Coordinator Statistics BLoC infrastructure
- Stats Repository data
- Supabase Stats Database Views infrastructure
- Organization Labels Provider infrastructure
- Organization Labels Provider infrastructure
- Stats Data Models data
Dependencies
- Filter Statistics by Time Window critical