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

Wrong sort by in spreadsheet plugin #316

Open
NisSAM opened this issue Sep 14, 2016 · 0 comments
Open

Wrong sort by in spreadsheet plugin #316

NisSAM opened this issue Sep 14, 2016 · 0 comments

Comments

@NisSAM
Copy link

NisSAM commented Sep 14, 2016

If x point value is a number but not an integer _.sortBy will be at least unstable and in worst case wrong.
To keep compatibility as much as we can I propose to change
from

    this.seriesData = _.sortBy(rows, function(row, x){
      return parseInt(x, 10);
    });

to

    this.seriesData = _.sortBy(rows, function(row, x){
      return (typeof row[0] === 'number') ? row[0] : parseInt(row[0], 10);
    });
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

1 participant