fix(emissionsRegion): move y-axis unit label out of bar area#72
Open
davidjablonski wants to merge 2 commits into
Open
fix(emissionsRegion): move y-axis unit label out of bar area#72davidjablonski wants to merge 2 commits into
davidjablonski wants to merge 2 commits into
Conversation
The unit label (e.g. "Mt CO₂eq") was rendered at x=margin.left+2, which placed it inside the chart area and caused it to overlap tall bars. The top gridline had a compensating 70px x-offset hack. Move the label to the left margin (right-aligned, above the top tick) and remove the gridline offset. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The unit label (e.g. "Mio. t", "GW") was rendered at x=2 inside the chart area at the top tick position, causing it to overlap tall bars. Move it to x=-4 (right-aligned, matching tick labels) and 12px above the top tick so it sits in the margin and never overlaps chart content. Update the opaque background rect to match the new position. Affects all charts using the AxisY primitive in 'all' or 'labels' mode, including productionBasedEmissions (reported in Slack 2026-05-06). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Two-commit fix for Y-axis unit labels overlapping chart bars (reported in Slack 2026-05-06):
Commit 1 — emissionsRegion custom SVG axis
Commit 2 — AxisY primitive (affects all charts using it)
Screenshot showing the bug in productionBasedEmissions ("10 Mio. t" overlapping bars, circled in red): reported by Adrian Hiss in #team_development
Test plan
🤖 Generated with Claude Code