fix(allocation): render distinct hourly bars on home page chart#275
Open
tormodmacleod wants to merge 1 commit into
Open
fix(allocation): render distinct hourly bars on home page chart#275tormodmacleod wants to merge 1 commit into
tormodmacleod wants to merge 1 commit into
Conversation
When `accumulate=hour` was selected on the home page Cost Allocation chart, all 24 hourly buckets collapsed into a single bar. Carbon Charts stacks bars sharing the same `group` field, and `getDateLabel` returned only month/day — so every hourly bucket received the same `MM/DD` group label and merged together. Include the hour (`MM/DD HH`) in the group label when accumulate is hourly. Other granularities (day, week, month, quarter, all) are unchanged because their bucket starts already produce distinct month/day labels. The Report Builder is unaffected: it uses recharts, which renders each data point as a separate bar regardless of duplicate labels. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Tormod Macleod <tormod.macleod@gmail.com>
✅ Deploy Preview for opencost-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Member
|
@tormodmacleod loks good to us, can you fix conflicts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR change?
Hourlygranularity collapsed all 24 hourly buckets into a single bar. Carbon Charts stacks bars that share the samegroupfield, andgetDateLabelreturned only month/day — so every hourly bucket received the sameMM/DDgroup label and merged together.getDateLabelnow includes the hour (MM/DD HH) whenaccumulate === "hour". Other granularities (day, week, month, quarter, all) are unchanged because their bucket starts already produce distinct month/day labels.Does this PR relate to any other PRs?
How will this PR impact users?
Hourlygranularity on the home page Cost Allocation chart will now see one bar per hour instead of a single merged bar. The data was always being fetched correctly from/allocation/compute— only the rendering was wrong.Does this PR address any GitHub or Zendesk issues?
How was this PR tested?
HourlywithWindow=Yesterdayand confirmed 24 distinct bars rendered (one per UTC hour), each labelledMM/DD HH.npm run typecheck— no new type errors introduced (the 57 pre-existing legacy errors are unchanged).Does this PR require changes to documentation?
Have you labeled this PR and its corresponding Issue as "next release" if it should be part of the next OpenCost release? If not, why not?