Skip to content
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

Highlight a specific part of a section in a pie chart. #586

Open
IoanaAlexandru opened this issue Mar 1, 2021 · 0 comments
Open

Highlight a specific part of a section in a pie chart. #586

IoanaAlexandru opened this issue Mar 1, 2021 · 0 comments
Labels
enhancement New feature or request Pie Chart

Comments

@IoanaAlexandru
Copy link

This may be a rather specific request, but please bear with me. I'd like to highlight a specific part (%) of a pie chart section(s) (maybe through transparency).

My use case is as follows: I'm using a pie chart for a class in university, to visually represent the weight of assignments (e.g. a project may be 30%, two homeworks 10% each and the exam 50% of the final grade). Now, for most classes, you need to do at least a bit of each assignment to pass, for instance 50% of each assignment (corresponding to 15%, 2x5% and 25% for the previous example). Sometimes it's more complicated, like you may need to do 50% of the exam and 50% of the other tasks in a cumulative manner (so you could do the project and get a max score, and not need to do the homeworks anymore).

For the first (simple) use-case, having a simple highlightValue property inside PieChartSectionData and a way to toggle whether I want sub-slices to be highlighted or not would suffice. I tried to use my bad photoshop skills to show a rough idea of what I mean by highlighting through transparency:

For the second use case, I'm not sure what the best visualisation would be, I'm open to suggestions. It would be interesting if we could define some pie chart data using a tree of values rather than a simple list. It would require PieChartSectionData to have another (optional) field containing a list of PieChartSectionData. For the second example above, this would look something like:

PieChart(
  PieChartData(
    sections: [
      PieChartSectionData(
        title: "Assignments",
        value: 50,
        highlightValue: 25,
        subsections: [
          PieChartSectionData(
            title: "Homework1",
            value: 10
          ),
          PieChartSectionData(
            title: "Homework2",
            value: 10
          ),
          PieChartSectionData(
            title: "Project",
            value: 30
          ),
        ]
      ),
      PieChartSectionData(
        title: "Exam",
        value: 50,
        highlightValue: 25,
      )
    ]
  ),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Pie Chart
Projects
None yet
Development

No branches or pull requests

2 participants