Skip to content

[Feature Request]: StackedPieChart (or radial stacked bar chart) #2003

@jay-k98

Description

@jay-k98

Description

It would be very useful to extend the current PieChart with support for stacked slices.
Instead of each slice containing a single value, a slice could contain a list of values (segments). These segments would be rendered as concentric radial bands inside the slice, similar to a stacked bar chart but in polar coordinates.

Example

Image

Proposed Solution

class StackedPieChartData extends BaseChartData {
  final List<StackedPieSectionData> sections;
  // ... other than that just the same props like in [PieChartData]
}

class StackedPieSectionData {
  final double weight;
  final double radius;
  final List<StackedPieSegmentData> segments;
  // ... other than that just the same props like in [PieChartSectionData]
}

class StackedPieSegmentData {
  final double value;
  final Color color;
  final Gradient? gradient;
}

Alternatives

I have considered Alternatives within and outside of fl_chart:

  • fl_chart: Put two or more [PieChart] inside a [Stack] -> Problem: Need to sync touch interactions and animations, which is tedious
  • Other packages: I tried using graphic, but the API is not convenient and features such as animations when selecting a slice was not possible

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions