HumbleSoftware / Flotr2

Graphs and Charts for Canvas in JavaScript.

Home Page:http://www.humblesoftware.com/flotr2/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong sort by in spreadsheet plugin

NisSAM opened this issue · comments

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