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 values.sort #56

Closed
Evildonald opened this issue Jul 20, 2010 · 2 comments
Closed

PieChart values.sort #56

Evildonald opened this issue Jul 20, 2010 · 2 comments

Comments

@Evildonald
Copy link

I'm not sure if this is intentional, but I found that no matter how I ordered my values, that the highest value would be first in the series.

Going through the piechart.js code I found that if I changed:

    values.sort(function(a, b)
    {
        return b.value - a.value; //sorted by value
    });

TO

    values.sort(function(a, b)
    {
        return b.order - a.order; //sorted by order
    });

then the values displayed in the chart according to order and not value.

@DmitryBaranovskiy
Copy link
Owner

This is intentional.

@Evildonald
Copy link
Author

Why do you even have an order field then?

You might want to consider giving users an option to pick this. It goes against how nearly every other charting system operates.
It took me about 45 minutes to work out why my values i specifically were adding in a certain order were being rendered in the opposite order I was indexing them in.

Either remove the order field (which currently does nothing), or give users the option to pick please.

thanks!

This issue was closed.
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