Skip to content

fix: Axis labels disappearing due to incorrect padding calculation in title filtering#2080

Merged
imaNNeo merged 2 commits intoimaNNeo:mainfrom
Enurian:bugfix/fixed-disappearing-side-titles
Apr 15, 2026
Merged

fix: Axis labels disappearing due to incorrect padding calculation in title filtering#2080
imaNNeo merged 2 commits intoimaNNeo:mainfrom
Enurian:bugfix/fixed-disappearing-side-titles

Conversation

@Enurian
Copy link
Copy Markdown
Contributor

@Enurian Enurian commented Mar 25, 2026

Description

This fixes issue #2078, #1963
The box that checks if titles should be drawn was calculated incorrectly, not taking different padding on different axis (and rotation) into account. If a "reserved space" property was larger than the height/width, it made the other titles disappear.
The fix is pretty straight forward in my opinion: Take these things into account.

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation and added dartdoc comments with ///.
  • I have updated/added relevant examples in example.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Fixes #2078

@Enurian Enurian changed the title fix: corrected title filtering Fix: corrected title filtering Mar 25, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.01%. Comparing base (9f74754) to head (3ee3a12).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2080      +/-   ##
==========================================
+ Coverage   93.00%   93.01%   +0.01%     
==========================================
  Files          50       50              
  Lines        3917     3924       +7     
==========================================
+ Hits         3643     3650       +7     
  Misses        274      274              
Flag Coverage Δ
flutter 93.01% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@imaNNeo imaNNeo changed the title Fix: corrected title filtering fix: corrected title filtering Apr 10, 2026
@imaNNeo imaNNeo changed the title fix: corrected title filtering fix: Corrected title filtering Apr 10, 2026
@imaNNeo
Copy link
Copy Markdown
Owner

imaNNeo commented Apr 10, 2026

Good catch. Thanks for the contribution.
As I understood, this bug has been happening since we added the rotationQuarterTurns property. right?

Are you able to add a test case for this fix?

@Enurian
Copy link
Copy Markdown
Contributor Author

Enurian commented Apr 10, 2026

Added a test.
No, I believe this bug was there for more than 2 years according to blame. Rotating (bar) charts just let this become an realistic issue, because you need a relatively short side. Basically every chart and every rotation is/was affected, when the ratio was not 1/1.

edit: By the way, there is a theoretical edge case that I did not test for or fix - if you set a reserved space larger than the (correct) related chart side, exceptions occur. But I guess that is user fault and would result in a stupid (not visible) chart anyways.

@imaNNeo imaNNeo changed the title fix: Corrected title filtering fix: Axis labels disappearing due to incorrect padding calculation in title filtering Apr 15, 2026
@imaNNeo
Copy link
Copy Markdown
Owner

imaNNeo commented Apr 15, 2026

Nice, thanks so much!

@imaNNeo imaNNeo merged commit 19a10f1 into imaNNeo:main Apr 15, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bar chart titles disappearing depending on other titles reserved space

2 participants