Conversation
378932b to
6a9aec1
Compare
d04f72f to
2ecef63
Compare
2ecef63 to
b88f01f
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2004 +/- ##
=======================================
Coverage 92.61% 92.62%
=======================================
Files 50 50
Lines 3873 3904 +31
=======================================
+ Hits 3587 3616 +29
- Misses 286 288 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi, thanks for your contribution. Just like what I did for the stacked bar chart here: #112 Please let me know your thoughts on it. |
|
Hi, yeah thank you for responding! I wanted to hear your opinion about that. I'll implement analogous to #112 and add tests :) |
|
I appreciate it! |
a47be1d to
e10651b
Compare
|
Hi @imaNNeo i was on vacation but now I'm back and implemented the stacked logic for PieChart. I also updated tests and added a new sample for the example app. Looking forward to your feedback :) |
c98c21b to
5bee1b4
Compare
Can you please update your branch with the latest changes? Then I can check it again. |
75f60a7 to
271d231
Compare
Hey, I updated the branch and removed CHANGELOG.md changes. |
|
Can you please update your branch? |
There was a problem hiding this comment.
Pull request overview
This pull request implements a "Stacked Pie Chart" feature that allows pie chart sections to contain multiple concentric segments (radial bands), addressing issue #2003. The implementation extends the existing PieChart functionality by adding segment support to PieChartSectionData.
Changes:
- Introduced
PieChartStackSegmentDataclass to represent individual segments within a pie chart section - Extended
PieChartSectionDatawithsegmentslist andsegmentsSpaceproperties to support stacked rendering - Refactored pie chart rendering to draw individual segments instead of full sections, using new
drawSegments,drawSegment, andgenerateSegmentPathmethods
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/src/chart/pie_chart/pie_chart_data.dart | Added PieChartStackSegmentData class, extended PieChartSectionData with segments support, added totalRadius calculation, updated lerp and equality methods |
| lib/src/chart/pie_chart/pie_chart_painter.dart | Refactored rendering logic from section-based to segment-based drawing, removed drawSection method, added drawSegments/drawSegment/generateSegmentPath methods, updated all radius calculations to use totalRadius |
| lib/src/utils/lerp.dart | Added lerpPieChartStackSegmentDataList function for segment animation support |
| test/chart/pie_chart/pie_chart_painter_test.dart | Updated tests to match new segment-based API, changed method calls from drawSection to drawSegment, updated path generation tests |
| test/chart/pie_chart/pie_chart_renderer_test.mocks.dart | Updated mocks to reflect new segment methods and removed obsolete drawSection mock |
| example/lib/presentation/samples/pie/pie_chart_sample4.dart | Added new sample demonstrating stacked pie chart with single segment per section |
| example/lib/presentation/samples/chart_samples.dart | Registered PieChartSample4 in the samples list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
271d231 to
ca2f3a3
Compare
|
@imaNNeo Thank you for responding. I updated the branch and applied the suggested changes of the copilot code-review. |
|
@imaNNeo I get your point and I like the idea of keeping it consistent. Also as you say it would lead to a more flexible solution, which I also appreciate. I will start refactoring and hit you up when I'm done. |
Signed-off-by: Jonas Klock <jonas.klock@exxeta.com>
Signed-off-by: Jonas Klock <jonas.klock@exxeta.com>
ca2f3a3 to
a3e7227
Compare
|
@imaNNeo I updated the branch and commited the refactored segment logic. I really like it because it is much cleaner and easier to understand. Thanks a lot for your feedback! Segment spacing can be solved by adding a segment. I provided that trick in the samples. Let me know if this is what you had in mind :) |
Signed-off-by: Jonas Klock <jonas.klock@exxeta.com>
a3e7227 to
839a611
Compare



As described in #2003 a "Stacked Pie Chart" was requested. This Pull Request aims to add this feature.
Solution
The Implementation of [StackedPieChart] is very similar to [PieChart]. The biggest difference is drawing a Section with multiple Segments.
The radius of a segment is calculated like this:
SegmentRadius = SectionRadius * SegmentValue / TotalSectionValues
The sweep angles are then calculated like in [PieChart]
Todo's and Improvements