You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request]: PieChart with exploding sections #2091
Highlighting a section by "exploding" it (or in other words sliding it outwards from the center) with smooth animations could add to the UX and add a new level of design possibilities for PieCharts.
Example
Proposed Solution
classPieChartSectionData {
// ...finaldouble sectionOffset;
// ...
}
classPieChartPainter {
// ...voiddrawSections(...) {
final section = data.sections[i];
if (section.value ==0) {
continue;
}
final sectionDegree = sectionsAngle[i];
// Compute offset for "exploded" sectionsfinal sectionCenterAngle = tempAngle + (sectionDegree /2);
final sectionOffset = section.sectionOffset;
final offsetDx =
math.cos(Utils().radians(sectionCenterAngle)) * sectionOffset;
final offsetDy =
math.sin(Utils().radians(sectionCenterAngle)) * sectionOffset;
final sectionCenter = center.translate(offsetDx, offsetDy);
// ...
}
}
Activity
jay-k98 commentedon Apr 22, 2026
Hey @imaNNeo me again! I guess you know the drill by now :D I prepared a PR and looking forward to your feedback! #2092