FFFF Refactor Graph page with Chart.js for current month daily spending · Issue #13 · laminko/SpendCheck · GitHub
[go: up one dir, main page]

Skip to content

Refactor Graph page with Chart.js for current month daily spending #13

Closed

Description

@laminko

Overview

Refactor the Graph page to use Chart.js library for better visualization. Replace the existing custom bar chart with a Chart.js implementation that shows current month daily spending with category-based visualization.

Requirements

Chart.js Integration

  • Replace custom bar chart with Chart.js bar chart component
  • Focus on current month data - show daily spending for the current month only
  • Dynamic title showing current month and year (e.g., "June 2025")
  • Category-based visualization - different colors for spending categories
  • Interactive features - tooltips, hover effects, responsive design

Chart Features

  • X-axis: Days of the current month (1-31 based on month)
  • Y-axis: Spending amounts with proper currency formatting
  • Categories: Visual distinction through colors/stacking for different spending categories
  • Responsive design: Works seamlessly on mobile and desktop
  • Empty state: Graceful handling when no data exists for the month

Technical Implementation

  • Install Chart.js and Chart.js Vue adapter if not present
  • Replace existing bar chart logic in Graph.vue
  • Aggregate spending data by day within current month
  • Group and color-code by categories
  • Maintain existing category colors from chartColors array
  • Keep existing segment controls but focus bar chart on current month

Data Processing

  • Filter entries to current month only
  • Group by date and category
  • Calculate daily totals and category breakdowns
  • Format currency amounts in tooltips and axes
  • Handle edge cases (no data, partial month data)

Acceptance Criteria

  • Chart.js library properly integrated
  • Bar chart shows current month daily spending only
  • Chart title dynamically shows current month/year
  • Categories are visually distinguished with colors
  • Chart is fully responsive
  • Interactive tooltips show detailed information
  • Empty state handled appropriately
  • Existing segment controls remain functional
  • Performance is maintained or improved

Technical Notes

  • Keep existing pie chart (categories) functionality unchanged
  • Maintain current color scheme from chartColors array
  • Ensure chart updates when new spending entries are added
  • Consider Chart.js plugins for enhanced functionality

Activity

  1. added this to the v1.0 milestone on Jun 13, 2025
  2. laminko commented on Jun 14, 2025

    @laminko
    OwnerAuthor

    📋 Related to ion-tabs implementation

    This issue is partially addressed in the feat/ion-tabs-navigation branch, which restructures the app layout but maintains the current 2-card statistics layout.

    Current State in Branch

    • Home tab still shows 2 cards: "Total Today" and "Total This Month"
    • Cards are properly styled and responsive
    • Ready to be updated to 3-card layout as specified

    Next Steps

    This could be:

    1. Addressed in current branch - Update to 3 cards before merging
    2. Separate follow-up - Implement 3-card layout in a new branch after ion-tabs merge

    The infrastructure is ready for this change in the current implementation.

  3. changed the title [-]Update statistics cards layout to 3 horizontal cards[/-] [+]Refactor Graph page with Chart.js for current month daily spending[/+] on Jun 14, 2025
  4. added a commit that references this issue on Jun 14, 2025
    508c3c6
  5. added 2 commits that reference this issue on Jun 22, 2025
    cc70ddb
    87f0d80
  6. added 2 commits that reference this issue on Jun 30, 2025
    0291a56
    dd9343c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0