Skip to content

[Feature Request]: PieChart with exploding sections #2091

Open

Description

@jay-k98

Description

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

Image
Image

Proposed Solution

class PieChartSectionData {
  // ...
  final double sectionOffset;
  // ...
}

class PieChartPainter {
  // ...
  void drawSections(...) {
      final section = data.sections[i];
      if (section.value == 0) {
        continue;
      }
      final sectionDegree = sectionsAngle[i];

      // Compute offset for "exploded" sections
      final 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

  1. jay-k98 commented on Apr 22, 2026

    @jay-k98
    ContributorAuthor

    Hey @imaNNeo me again! I guess you know the drill by now :D I prepared a PR and looking forward to your feedback! #2092

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions