-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Add borderRadius support to PieChartPainter #1822
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
Conversation
| FlBorderData? borderData, | ||
| required this.touchData, | ||
| }) : borderData = borderData ?? FlBorderData(); | ||
| BorderRadius? borderRadius, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to have borderRadius property here in our base chart data. (So we don't need to have it for all the charts. And if we do, we should have it around the chart. Not something that only applies for the pie section paths)
So please remove it from here and just add it inside the PieChartSectionData
| Rect bounds = sectionPath.getBounds(); | ||
| Path roundedPath = Path() | ||
| ..addRRect( | ||
| RRect.fromRectAndCorners( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the better idea is just to edit the shape path generation logic here:
fl_chart/lib/src/chart/pie_chart/pie_chart_painter.dart
Lines 220 to 227 in 01689ee
| var sectionPath = Path() | |
| ..moveTo(startLine.from.dx, startLine.from.dy) | |
| ..lineTo(startLine.to.dx, startLine.to.dy) | |
| ..arcTo(sectionRadiusRect, startRadians, sweepRadians, false) | |
| ..lineTo(endLine.from.dx, endLine.from.dy) | |
| ..arcTo(centerRadiusRect, endRadians, -sweepRadians, false) | |
| ..moveTo(startLine.from.dx, startLine.from.dy) | |
| ..close(); |
|
You're right, sorry for that inconsistency |
|
No worries! Please follow it here: #2024 |

What’s New?
borderRadiuscapability to thePieChartPainterfor enhanced customization.Why?
To provide developers with more flexibility in customizing the appearance of pie chart segments.
Testing
borderRadiusvalues.