Skip to content

Wrong legend value on series mapping #10005

Closed

Description

@kai2468

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

Activity

  1. sebastianbochan commented on Jan 28, 2019

    @sebastianbochan
    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.

  2. stale commented on Sep 1, 2020

    @stale

    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!

  3. added
    Status: StaleThis issue hasn't had any activity for a while, and will be auto-closed if no further updates occur.
    on Sep 1, 2020
  4. kai2468 commented on Jan 27, 2021

    @kai2468
    ContributorAuthor

    Any chance this can get looked at?

  5. PaulDalek commented on Jan 28, 2021

    @PaulDalek
    Contributor

    Unstale.

  6. removed
    Status: StaleThis issue hasn't had any activity for a while, and will be auto-closed if no further updates occur.
    on Jan 28, 2021
  7. PaulDalek commented on Jan 28, 2021

    @PaulDalek
    Contributor

    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;
      }
    }
    
  8. maciejBL commented on Jan 26, 2023

    @maciejBL

    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.

  9. self-assigned this
    on Jan 27, 2023
  10. added a commit that references this issue on Feb 7, 2023
    f8218b6
  11. added a commit that references this issue on Feb 8, 2023
    724334d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions