Skip to content
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

[Lens] Wrong series ordering in legend #122329

Closed
oldrich-svec opened this issue Jan 5, 2022 · 8 comments
Closed

[Lens] Wrong series ordering in legend #122329

oldrich-svec opened this issue Jan 5, 2022 · 8 comments
Labels
enhancement New value added to drive a business result Feature:Lens impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@oldrich-svec
Copy link

Kibana version: v 7.16.2

Description of the problem including expected versus actual behavior:

  • Before update to v 7.16.2 the series in the legend were sorted as largest series in the top
  • After update to v 7.16.2 the largest series is sorted at the bottom of the legend (figure 1)
  • If I change "Rank direction" from "descending" to "ascending" the largest series is at the top but the colors are also reverted which means that you cannot rely on that the largest series have always the same color. (figure 2)

image

image

@botelastic botelastic bot added the needs-team Issues missing a team label label Jan 5, 2022
@nickpeihl nickpeihl added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Jan 6, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Jan 6, 2022
@ghudgins
Copy link
Contributor

ghudgins commented Jan 7, 2022

I don't believe this behavior has changed. If you want consistent colors try ranking by "alphabetical" instead....as count of records ascending / descending will always depend on the data.

stacked visualizations do "flip the legend" over their non-stacked counterparts. So the first value to be added is added to the bottom of the stack (and shows up at the bottom of the legend). This can sometimes throw a curve ball if you get used to looking at the non-stacked bars...but it is conforming to a data visualization best practice.

I could totally be wrong - but just did some tests on my end comparing 7.14 to 7.16.2 and didn't see any notable changes when recreating this visualization with sample data...

@oldrich-s
Copy link

oldrich-s commented Jan 7, 2022

I do not remember what version we were running before the update but it might be version just after the licence change - so relatively old version 😇. Edit: Probably v 7.11.

So the first value to be added is added to the bottom of the stack (and shows up at the bottom of the legend).

That is the problem. In the old version of Kibana the sentence was like:

So the first value to be added is added to the bottom of the stack (and shows up at the top of the legend).

So in the old version the first and most important series was at the top of the legend and now the first and most important series is at the bottom of the legend (which means you have to scroll to find the most important series).

Is there a way how to get back the old style? Alphabetical ranking is not an option and so far I was not able to set it up so that "the first series is at the top of the legend"

Edit:

If you want consistent colors try ranking by "alphabetical" instead....as count of records ascending / descending will always depend on the data.

The colors always start the same (green, blue, red...) so they are consistent to me. The color should match the significance (biggest to smallest) not the particular series (such as HACH). The colors should be consistent in the sense that the largest series has always the same color, the second largest series has always the same color etc.... and the most significant series (the biggest and added as first) should be at the top of the legend.

@flash1293
Copy link
Contributor

flash1293 commented Jan 7, 2022

The legend order was actually different at some point but it got adjusted. @nickofthyme @markov00 don you have more context here?

I can confirm the current behavior is happening on purpose as it syncs the order of the bar slices with the order of the legend entries (the “top” bar slice is also the top legend entry, KKRA in your case). I definitely see the need for adjusting legend ordering though - it’s valid and something we should provide a solution for

In general it’s planned to give the user more control over the ordering of bars, legend and so on (cc @dej611 - legend ordering is also a use case here) I would like to implement a one-off fix for this because it will be hard to maintain - instead this should be considered as one of the use cases of a unified client side sorting control

@flash1293 flash1293 added the enhancement New value added to drive a business result label Jan 7, 2022
@flash1293
Copy link
Contributor

Related to #86184

@dej611
Copy link
Contributor

dej611 commented Jan 10, 2022

In general it’s planned to give the user more control over the ordering of bars, legend and so on (cc @dej611 - legend ordering is also a use case here) I would like to implement a one-off fix for this because it will be hard to maintain - instead this should be considered as one of the use cases of a unified client side sorting control

True. I've started to discuss with the datavis team on having separate sorting predicate for the legend, but that's still a work in progress.

@stratoula stratoula added the impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. label Jan 16, 2023
@markov00
Copy link
Member

markov00 commented Feb 2, 2023

This request is the opposite of this old one: #3118
We definitely need to provide a switch to sort the legend in one or the other direction

@stratoula
Copy link
Contributor

This will be fixed by this #86190 so I am closing this in favor of the aforementioned feature request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Lens impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

9 participants