Fix messages per day chart x-axis overflow #111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #18
The Problem
The "Messages per day" chart on the /stats page got stuck at March 2025 because the x-axis scale calculation couldn't handle the growing number of days of data.
Root Cause Analysis:
The previous bar width calculation:
When
total_daysgrew large (e.g., 600+ days since community started):.maxwould pickmin_bar_width = 0.15600 * (0.15 + 0.05) = 120%widthThe Solution
Replaced with adaptive scaling logic that:
Visual Result
The chart will now display all data correctly regardless of how many days of messages exist in the community.
Testing
AI Disclosure
This PR was developed with AI assistance: