Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Specifying certain colors for a dataset in charts

    Hi there,
    I have a question regarding facet chart colors. Each facet chart has its own color set. Each line in a line chart gets its color from the color set by its index. Now assume that we have a dynamic chart, where you can see the annual salary of persons for each year. You can add new lines to the charts by selecting persons, and remove them by deselecting them. So the problem is, when I have several persons selected, and now I deselect the first one, it will be removed from the chart, and the index of the other persons will be reduced by one and hence the color for each person changes, which may lead to confusion as you can see from the gif below.



    I think this issue could be easily solved by passing a colorIndex to facet values. This way, when filling the chart with lines, we could pass a color index to each person. When removing the first line, the first color will just not be in use, but the other lines will still use their respective colors, which would be a better user experience in my opinion. Do you have an API for that already, or any other suggestion how I could solve my issue?

    Best regards

    #2
    getDataColor() is an override point that you can use to keep the colors consistent across data removal.

    Comment


      #3
      Thanks for the repsonse, we could archieve the behaviour with an override of the recommended method.

      Comment

      Working...
      X