question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to choose the items order in Donut chart?

See original GitHub issue

Hi everyone,

I would like to show several items in the donut chart in a specific order.

Example: const data = [ { quantity: 20, name: 'critical', id: 1 }, { quantity: 30, name: 'normal', id: 2 }, { quantity: 50, name: 'good', id: 3 } ]

In this case, the “good” slice will be the first displayed in the donut in the clockwise rotation, then the “normal” slice and finally the “critical” slice, because briteCharts generates from the biggest slice to the smallest, right?

Is it possible to define my own order, like using the ids ? If it’s the case, I didn’t find how to do that in the documentation.

Sorry for my poor English and thank you for your help !

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Golodhroscommented, Aug 2, 2017

So, I checked with @evb-sun and we think we will prefer to keep the default order as it is and add the option to change it.

The resultant API would be something like: donut.orderingFunction(fn);

where the fn would be something like: (a, b) => b.quantity + a.quantity

or similar.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Present your data in a doughnut chart - Microsoft Support
Rotate the slices in a doughnut chart​​ In a doughnut chart, click the data series or a data point, or do the following...
Read more >
Solved: Pie Chart Order of Slices (NOT accordingly to lett...
It is important that you use "Sort by column" from the upper menu after you have selected the Category column. From the options...
Read more >
A Complete Guide to Pie Charts | Tutorial by Chartio
Pie charts are a common but often misused visualization to show division of a whole into parts. Learn how to get the most...
Read more >
Create a Doughnut Chart - YouTube
A doughnut chart is similar to pie chart in that it's round, but that where most of the similarities stop. Doughnut charts have...
Read more >
Numbers Donut Charts (#1633) - YouTube
https://macmost.com/e-1633 A new feature of Numbers, Pages and Keynote is the ability to use Donut charts instead of Pie charts to represent ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found