Skip to content

Wrong legend value on series mapping #10005

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

Closed
kai2468 opened this issue Jan 28, 2019 · 6 comments · Fixed by #18455
Closed

Wrong legend value on series mapping #10005

kai2468 opened this issue Jan 28, 2019 · 6 comments · Fixed by #18455
Assignees

Comments

@kai2468
Copy link
Contributor

kai2468 commented Jan 28, 2019

Expected behaviour

Would expect the legend to stay the same if the series mapping is changed

Actual behaviour

Legend value changes from "Column 1" to "Column 2"

Live demo with steps to reproduce

http://jsfiddle.net/h6L7r2vw/

  • At start legend is set to Column 1
  • Remove label: 0 from series mapping
  • Now legend is set to Column 2

Product version

Latest

@sebastianbochan
Copy link
Contributor

Hi @kai2468,
Thank you for reporting.

Internal note
@TorsteinHonsi is it a bug or default functionality? I was not able to find any information about it in docs.

@stale
Copy link

stale bot commented Sep 1, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!

@stale stale bot added the Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. label Sep 1, 2020
@stale stale bot closed this as completed Sep 8, 2020
@kai2468
Copy link
Contributor Author

kai2468 commented Jan 27, 2021

Any chance this can get looked at?

@PaulDalek
Copy link
Contributor

Unstale.

@PaulDalek PaulDalek reopened this Jan 28, 2021
@stale stale bot removed the Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. label Jan 28, 2021
@PaulDalek
Copy link
Contributor

PaulDalek commented Jan 28, 2021

Hi @kai2468

Thank you for contacting us. In short, the 0 indexed value shouldn’t be considered as a series name but setting the label option with 0 makes it possible.

Internal note
It comes from the SeriesBuilder’s read function, more precisely from the below piece of code that is responsible for removing index of the x property. Setting any custom parameter with 0 index makes it still considered when looking for an index of a name.

if (typeof this.name === 'undefined' && builder.readers.length >= 2) {
  columnIndexes = builder.getReferencedColumnIndexes();
  if (columnIndexes.length >= 2) {
    // remove the first one (x col)
    columnIndexes.shift();
    // Sort the remaining
    columnIndexes.sort(function(a, b) {
      return a - b;
    });
    // Now use the lowest index as name column
    this.name = columns[columnIndexes.shift()].name;
  }
}

@maciejBL
Copy link

Hi, could we get back to the topic, since this is currently a big blocker in our project.

I've prepared the jsfiddle demo (https://jsfiddle.net/rs4vLu78/58/) to depict what's the problem, I would expect here to have different labels for series, independently from the seriesMapping contains.

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

Successfully merging a pull request may close this issue.

7 participants