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] Chart switcher does not preserve original axis dimensions depending on drop order #84126

Closed
dej611 opened this issue Nov 23, 2020 · 7 comments
Labels
enhancement New value added to drive a business result 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 23, 2020

On the Lens editor, the order of axis/dimension assignment can lead to different results when switching from XY to pie and back XY.

Given the drop order: Horizontal -> Break down by -> Vertical, the Horizontal and Break down by dimension will be swapped when switching to a Pie chart. This becomes evident when returning to a XY chart again: Horizontal and Break down by fields are now swapped:

unstable_order_switch

Given the drop order: Break down by -> Horizontal -> Vertical, the same route gives consistent results:

unstable_order_switch_right

@dej611 dej611 added Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Nov 23, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@wylieconlon
Copy link
Contributor

I thought we were already handling this logic, but it seems like it might not be correct. Basically the logic for selecting the axis should be:

  • If there is exactly one histogram, that is the X axis regardless of order
  • If there are no histograms, the X axis is the first bucketed agg
  • If there are 2 histograms, the X axis is the first bucketed agg

Some examples in a table:

Order of aggs X axis Break down
Terms, Date histogram Date histogram Terms
Date histogram, terms Date histogram Terms
Number histogram, terms Number histogram Terms
Terms, number histogram Number histogram Terms
Terms, Filters Terms Filters
Filters, Terms Filters Terms
Number histogram, date histogram Number histogram Date histogram
Date histogram, number histogram Date histogram Number histogram

@flash1293
Copy link
Contributor

Is it even possible to fix this bug with the state structure we have today? As the assignment of x and split dimensions can be changed by the user but we don't persist this choice when moving away from xy to pie, we have no way of always restoring the previous state when going back to xy.

So, just for clarification - do we want to make sure we always get back to the very same state or do we want to make it more likely by improving the assignment logic for x vs splitby?

@flash1293 flash1293 added the enhancement New value added to drive a business result label Nov 24, 2020
@wylieconlon
Copy link
Contributor

wylieconlon commented Nov 24, 2020

@flash1293 I don't think we can fully fix this bug for the reason you mentioned. I think the rules above will provide what users expect, because it's basically the existing logic for generating suggestions as part of the XY charts.

@dej611
Copy link
Contributor Author

dej611 commented Dec 10, 2020

Should we close this as won't fix maybe?

@flash1293
Copy link
Contributor

If we can confirm the rules from Wylies table are working (easy to check by going to table, configuring it, then switching to bar), I'm fine with closing this for now.

@stratoula stratoula added the impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. label Sep 6, 2023
@stratoula
Copy link
Contributor

Thank you for contributing to this issue, however, we are closing this issue due to inactivity as part of a backlog grooming effort. If you believe this feature/bug should still be considered, please reopen with a comment.

@stratoula stratoula closed this as not planned Won't fix, can't repro, duplicate, stale Jan 30, 2024
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: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

No branches or pull requests

5 participants