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

PieChart does not preserve order of values #4

Closed
dennisjac opened this issue Mar 3, 2015 · 3 comments
Closed

PieChart does not preserve order of values #4

dennisjac opened this issue Mar 3, 2015 · 3 comments

Comments

@dennisjac
Copy link

I just created a small test of a PieChart and noticed that apparently The values are not rendered in the same order as they are provided. When I provide the values [x,y,z] they are instead rendered as for example [y,x,z].

@codesuki
Copy link
Owner

codesuki commented Mar 3, 2015

I will have a look. Thanks for noticing!

@codesuki
Copy link
Owner

D3.js sorts the Pie Chart by default but there is a way to disable that. After I thought about how to implement that API-wise I will make it optional.

@codesuki
Copy link
Owner

I added an optional sort= property to the PieChart. It behaves like d3 pie.sort() https://github.com/mbostock/d3/wiki/Pie-Layout
Default is to sort by value, and if you set the prop to null no sorting will be done. You can also supply your own sort function. Will update Readme and publish update later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants