elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.48k stars 8.05k forks source link

[Discover][ES|QL] Filtering by clicking should keep the selected chart type #184631

Open stratoula opened 1 month ago

stratoula commented 1 month ago

Describe the feature:

Recently we added the support of creation of where filters when we are clicking on a:

This is very cool but if the user has selected a different chart type (for example a tagcloud) and then clicks to add a filter then the user's selection chart type is being lost and the default one is being rendered (which is usually an XY chart). This happens also in a saved search.

Ideally we dont want filtering to change our chart configuration.

elasticmachine commented 1 month ago

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

elasticmachine commented 1 month ago

Pinging @elastic/kibana-esql (Team:ESQL)

stratoula commented 1 month ago

@jughosta not sure how easy it will be to accomplish that but it would be very cool 😍

jughosta commented 1 month ago

The chart style gets reset when query changes. It's the case here too as "where" clause gets added. Need to think what kind of special handling we could add for the check on query change.

stratoula commented 1 month ago

I was thinking about it. Maybe we should check if the chart used columns (fields) exist in the updates query. In case they do, we should not change the chart type. The suggestionsapi has the preferredChartType property that we can possibly use.