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] add option hide/show/auto legend to XY Chart #67310

Closed
mbondyra opened this issue May 26, 2020 · 8 comments · Fixed by #70619
Closed

[Lens] add option hide/show/auto legend to XY Chart #67310

mbondyra opened this issue May 26, 2020 · 8 comments · Fixed by #70619
Assignees
Labels
Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@mbondyra
Copy link
Contributor

mbondyra commented May 26, 2020

As a user, I want to be able to set legend display option. The design should be probably aligned with pie (cc @cchaos, can you verify?)

image

Assumptions:

  1. Due to design limitations, legend is being set up on layer level, not visualisation level. (to discuss)
  2. By default legend display is setup to 'auto' (current behaviour)

Doubts:
On dashboards, there's an icon:
image
That toggles the legend. I am not sure how discoverable it is and it might be difficult to implement. Do we want it in lens?

Related: #34102

@mbondyra mbondyra added Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens :Lens/basic-expectation labels May 26, 2020
@elasticmachine
Copy link
Contributor

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

@timroes
Copy link
Contributor

timroes commented May 26, 2020

  1. Due to design limitations, legend is being set up on layer level, not visualisation level. (to discuss)

Could you elaborate on that please. What is the limitation? Is the only limitation we don't have a place to put "overall chart settings" somewhere? Because I think we discussed that a couple of times, that we def need that place, and just need designs on where overall chart settings are going.

On dashboards, there's an icon:

Small correction: this is not dashboard related. That icon is the implementation in vislib charts (no matter where) to toggle the legend. I am neither really concerned it's that well detectable and not sure if we should use the same pattern to toggle chart legends temporarily with the new charts. Maybe @markov00 has some ideas how we want to make legends toggable in charts?

@mbondyra
Copy link
Contributor Author

mbondyra commented May 26, 2020

Is the only limitation we don't have a place to put "overall chart settings" somewhere?

exactly.

@markov00
Copy link
Member

markov00 commented May 27, 2020

Maybe @markov00 has some ideas how we want to make legends toggable in charts?

I think we should provide the same pattern for every chart as we are already doing in vislib/tsvb etc: show the overlay button to toggle on/off the chart if the legend setting is turned on or in auto mode.
btw what does it mean auto? show the legend if we have enough space, or lets the dashboard user toggle on/off the legend?

@mbondyra
Copy link
Contributor Author

tsvb doesn't have this functionality. Auto would behave like right now -> if there's only one yAccessor and no splitAccessor (think only count of records), the legend is not being shown. Otherwise it is shown.

@cchaos
Copy link
Contributor

cchaos commented May 27, 2020

To put it less technically 😉 , if there's more than a single series and colors are used to distinguish categories, the auto option will always show the legend, but it will hide the legend if there's only a single series.

The old legend toggle that exists in TSVB and Visualize should not be applied to Lens. This was a hotfix for supporting how those two applications handled the visibility of the legend.

Hiding legends from charts that have more than a single series makes the charts unreadable. It doesn't really make sense to make this a non-saved visual option (the way it's handled in Dashboards). It should continue (in Lens) to be part of the saved options of the chart.

We will get to a point where Dashboard to Lens is a much smoother process and where the owner can then decide if the legend provides value to the chart or not and easily edit the Lens to change this saved option.

@flash1293
Copy link
Contributor

Depends on #67384

@wylieconlon
Copy link
Contributor

I agree with @cchaos that hiding the legend would cause a subset of charts to be less readable in a dashboard, but that doesn't necessarily mean we should skip this feature. The users who are asking for this want it because it's a denser display, and because they primarily use the tooltips to investigate the data, so we should enable that use case.

I'm not sure we should support a "show legend" option though. We hide the legend when there is a single Y axis, because it duplicates the name of the function with the Y axis label. The duplicate information suggests that this option is not required.

Because of these reasons, I don't think this is actually a "basic expectation" for Lens.

@flash1293 flash1293 mentioned this issue Jul 2, 2020
2 tasks
@flash1293 flash1293 self-assigned this Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants