Skip to content

Wrong sort by in spreadsheet plugin #316

@NisSAM

Description

@NisSAM

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);
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions