Skip to content
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

New property PieChartData.titleSunbeamLayout to rotate the titles of each section of the chart #1582

Merged
merged 4 commits into from
May 9, 2024

Conversation

herna
Copy link

@herna herna commented Feb 8, 2024

The idea is taken from the following library, property labelSunbeamLayout: https://krispo.github.io/angular-nvd3/#/pieChart

You can set the property titleSunbeamLayout in PieChartData to rotate the titles.

By default is set to false to not modify any existing code:
2024-02-08 09 54 06

By if you set it true it'll look like this:
2024-02-08 09 55 04

This is specially useful for large sets of data where titles can easily overlap.

Copy link

codecov bot commented Feb 28, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 86.29%. Comparing base (2ff658b) to head (3f8fa49).
Report is 25 commits behind head on main.

❗ Current head 3f8fa49 differs from pull request most recent head 20a266f. Consider uploading reports for the commit 20a266f to get more accurate results

Files Patch % Lines
lib/src/chart/pie_chart/pie_chart_painter.dart 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1582      +/-   ##
==========================================
- Coverage   86.38%   86.29%   -0.09%     
==========================================
  Files          45       45              
  Lines        3047     3051       +4     
==========================================
+ Hits         2632     2633       +1     
- Misses        415      418       +3     

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

@imaNNeo
Copy link
Owner

imaNNeo commented Feb 28, 2024

It is a nice feature.
Thank you so much
btw, there is an issue, I think the pointed value should be upside down.

Screenshot 2024-02-28 at 21 49 51

@imaNNeo
Copy link
Owner

imaNNeo commented Feb 28, 2024

Also, you need to write some unit-tests
Follow the contributing guideline:
https://github.com/imaNNeo/fl_chart/blob/main/CONTRIBUTING.md

@herna
Copy link
Author

herna commented Mar 6, 2024

I made a typo on the upper limit to rotate the title, well-trained eye 😃

I also wrote some unit tests and made some other minor adjustments, let's see now.

@imaNNeo
Copy link
Owner

imaNNeo commented Apr 15, 2024

Thank you so much!
It's approved and ready to be merged.
Just a minor thing to do, can you please update the pie_chart.md documentation to add the new property?

@herna
Copy link
Author

herna commented Apr 19, 2024

Done @imaNNeo

@imaNNeo imaNNeo merged commit 5a0bebc into imaNNeo:main May 9, 2024
2 checks passed
@imaNNeo
Copy link
Owner

imaNNeo commented May 9, 2024

Thanks for your contribution!

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.

3 participants