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] All layers are cleared when switching from multi-layer XY chart to any other XY chart #71372

Closed
cchaos opened this issue Jul 10, 2020 · 4 comments · Fixed by #71982
Closed
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@cchaos
Copy link
Contributor

cchaos commented Jul 10, 2020

Kibana version: 7.9/Master

Describe the bug:

Lens should be able to handle switching between XY chart types when there are multiple layers, but instead it tells me it's not going to work, then when I do it anyway, all layers are gone and the chart switcher makes it look like it never switched.

Steps to reproduce:

  1. Create any XY type of chart (i.e. Bar)
  2. Add a second layer
  3. Try switching to a different type of XY chart (i.e. Line)

Screenshots (if relevant):

https://share.getcloudapp.com/4gujG7nm

Errors in browser console (if relevant):

No errors thrown anywhere

@cchaos cchaos added bug Fixes for quality problems that affect the customer experience Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Jul 10, 2020
@elasticmachine
Copy link
Contributor

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

@flash1293
Copy link
Contributor

flash1293 commented Jul 10, 2020

This might be caused by #64613

Chart switches among sub types use the suggestion system now but the suggestion system can’t handle multiple layers (at least that was the case in late 2019, maybe I missed a change till then). @wylieconlon can we extend the suggestion system to handle multiple layers correctly in this specific scenario?

Also seems like this scenario is worth a functional test.

@wylieconlon
Copy link
Contributor

It looks like this issue is happening in all XY charts that include a second layer, whether or not the second layer has data. The issue is not a crash, because if you click the "add layer" button in the right panel things go back to normal.

I also checked and the "most correct" suggestion is actually generated by both the datasource and visualization. I think the issue is mostly about how we sort and filter suggestions in the chart switcher. I think the only way to solve this issue is to add more information to the suggestions request so that the datasource and visualization can be more aware that the suggestion will be used for chart-switching purposes.

@wylieconlon
Copy link
Contributor

I realized I hadn't addressed all the points you made @flash1293:

  1. Yes, layers are handled in suggestions using a parameter keptLayerIds. The coordination of adding and removing layers is now done by the editor, making it more reliable.
  2. This definitely needs a functional test.

@wylieconlon wylieconlon changed the title [Lens] Application freaks out when switching chart types with multiple layers [Lens] All layers are cleared when switching from multi-layer XY chart to any other XY chart Jul 13, 2020
@wylieconlon wylieconlon self-assigned this Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants