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] Stacked problem with negative values #118066

Closed
dej611 opened this issue Nov 9, 2021 · 7 comments · Fixed by #120271
Closed

[Lens] Stacked problem with negative values #118066

dej611 opened this issue Nov 9, 2021 · 7 comments · Fixed by #120271
Labels
blocked bug Fixes for quality problems that affect the customer experience Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@dej611
Copy link
Contributor

dej611 commented Nov 9, 2021

Describe the bug:

Depending on the order of the dimensions, stacking charts can have weird results:

Screenshot 2021-11-09 at 19 08 36

Screenshot 2021-11-09 at 19 08 45

Screenshot 2021-11-09 at 19 12 50

Screenshot 2021-11-09 at 19 12 57

Screenshot 2021-11-09 at 19 12 04

Screenshot 2021-11-09 at 19 12 13

Percentage charts are even more strange with the bigger segment filling up the 100% span:

Screenshot 2021-11-09 at 19 14 55

Screenshot 2021-11-09 at 19 15 02

Steps to reproduce:

  1. Create a count() formula
  2. Add a new formula of the form of -3 * count()
  3. Reorder the dimension to have different results with stacked

Expected behaviour

Not sure here. Perhaps it's worth discussing with @markov00 and @monfera some ideas.

@dej611 dej611 added bug Fixes for quality problems that affect the customer experience Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels Nov 9, 2021
@elasticmachine
Copy link
Contributor

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

@flash1293
Copy link
Contributor

I agree, those cases are weird. Maybe we should show a warning if there are negative values in stacked series? Not sure whether we can do much better.

@dej611
Copy link
Contributor Author

dej611 commented Nov 10, 2021

One idea it comes to mind would be to sort, for each column, the order having the negative values always at the bottom.
Because of the color mapping, changing the sorting on one bucket seems achievable without losing any information.

As for the Percentage chart, probably considering the Math.abs of the value instead of the raw value can be an idea? That would be achievable also on the consumer side.

@flash1293
Copy link
Contributor

Interesting ideas. Can we control the order per column from the Kibana side?

@flash1293
Copy link
Contributor

Marking as blocked for now

@nickofthyme
Copy link
Contributor

I was hopeful this fix would get into 7.16.1 but unfortunately it was MUCH more involved than expected. See fun stacking logic here. I am working to add this to 8.0 in #120271.

@flash1293
Copy link
Contributor

Fixed by now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked bug Fixes for quality problems that affect the customer experience Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants