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

csv data - series names are random when seriesMapping object property has value more than 10. #8662

Closed
wchmiel opened this Issue Jul 23, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@wchmiel
Contributor

wchmiel commented Jul 23, 2018

Expected behaviour

appropriate series names when data loaded from csv file and seriesMapping property value is more than 10.

Actual behaviour

series names are get from csv file randomly (first row of csv file).

Live demo with steps to reproduce

https://jsfiddle.net/wchmiel/64bcp0Lq/

  1. set var in seriesMapping more than 10 and run example
  2. check particular series name - it should't be correct
  3. set var in seriesMapping less than 10 and run example
  4. check particular series name - it should be correct

Product version

Highcharts

Affected browser(s)

all

@pawelfus pawelfus added the Bug label Jul 24, 2018

@pawelfus

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Jul 24, 2018

Contributor

Internal note:
Issue comes from these lines:

if (columnIndexes.length >= 2) {
// remove the first one (x col)
columnIndexes.shift();
// Sort the remaining
columnIndexes.sort();
// Now use the lowest index as name column
this.name = columns[columnIndexes.shift()].name;
}

Where [5, 10].sort() results as [10, 5] (string sorting conversion).

Contributor

pawelfus commented Jul 24, 2018

Internal note:
Issue comes from these lines:

if (columnIndexes.length >= 2) {
// remove the first one (x col)
columnIndexes.shift();
// Sort the remaining
columnIndexes.sort();
// Now use the lowest index as name column
this.name = columns[columnIndexes.shift()].name;
}

Where [5, 10].sort() results as [10, 5] (string sorting conversion).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment