-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUGFIX Fix bargraph overflow #1468
Conversation
- If bargraphs overflow with BarChartAlignment.start, BarChartAlignment.center or BarChartAlignment.end, use BarChartAlignment.spaceEvenly to shrink all bars to the available space - Update documentation for BarChartData.groupsSpace
Codecov Report
@@ Coverage Diff @@
## master #1468 +/- ##
==========================================
- Coverage 86.67% 86.45% -0.22%
==========================================
Files 45 45
Lines 3016 2998 -18
==========================================
- Hits 2614 2592 -22
- Misses 402 406 +4
... and 4 files with indirect coverage changes 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
Hi, please read the Contributing guideline carefully
|
@imaNNeo I just added a widget test (with golden files). I didn't find another way to check if the bars are drawn outside of the diagram. I can't check for the bars with a finder due to the fact that they are rendered on the canvas. |
Nice, I need to learn more about the golden tests. |
Hey @imaNNeo , thanks for merging. For golden tests I can also recommend the following package. |
Golden tests are a good way to see if something has changed drastically. It's just that golden tests give different results on different OS - I think there should be some fault tolerance (0.2 - 0.3%) for the tests. At least for me, because I use Windows, I get failed tests on
|
Quote from link: Golden tests may be executed locally on Linux, MacOS, and Windows platforms. All reference images can be found at Flutter Gold baselines. Some tests may have multiple golden masters for a given test, to account for rendering differences across platforms. The parameter set for each image is listed in each image digest to differentiate renderings. |
@k0psutin You're right, I get about 93% diff on my machine 😆 |
@imaNNeo sorry if the golden test make issues. @k0psutin https://stackoverflow.com/a/73048760/3607358 or I use this also for my tests in another project. @imaNNeo but 93% diff is another level. There must be something completely off on your side. Did you check the failure images? |
Yeah, this is how I did it for one project. I think it would be good to implement this so that, there is no need to maintain golden files for every OS. @imaNNeo 93% sounds quite high. Maybe the new Flutter version (3.16.0) gives that 93%? I'm not sure if I ran it on 3.13.6 before 🤔 |
No worries @bobatsar Yes, I was in the latest version (3.16.0). |
BarChartAlignment.start
,BarChartAlignment.center
orBarChartAlignment.end
, useBarChartAlignment.spaceEvenly
to shrink all bars to the available spaceBarChartData.groupsSpace
If the automatic approach to shrink all bars is not desired, another option would be to add other alignments e.g.
BarChartAlignment.startShrink
or another parameter to enableshrink on overflow
.