Dynamically show or hide visualisation using control

Hi,
I'm using a pie chart to display the % of counts of items from different categories. However, I don't want to display the chart until a category is first chosen from an options control.
E.g. there are 2 categories: "fruits" and "cars brands", but I don't want to display a chart with the combined proportion of fruits AND cars (because this wouldn't really make sense!).
I would like it to not appear until a category is chosen, and then display the proportion of the items in whichever category was chosen (such as 65% pears, 10% apples, 25% oranges).
Someone suggested using markdown visualizations, but I'm not sure how that would work. Or perhaps a markdown widget?
Thanks

Hello Anton!

I don't think we have a markdown widget that is that flexible, for dashboards, yet. Current markdown support for Dashboard panels seems to be limited to static text.

In Kibana 7.13, I was able to create a "nested" pie chart by dropping two fields in the Lens editor. The first one becomes the "inner circle", and the second field is then used to populate the outer ring. When I add a control option picker on the first field, and then select one of the values from the control, the inner circle goes 100% and the outer ring is just pie chart for the docs matching that first field.

Not perfect, but probably better than a simpler pie chart for just one field.

It may be possible to do something like this in Canvas, though this would probably also require writing some custom expressions.

Here's the pie chart when I haven't selected the value for the first field yet; the option control offers to pick from "alerting" or "actions", which, when picked, will "shrink" the green or blue slices, depending on which one was picked.

image

Kibana 7.13 also supports drilldowns, which is a way to link to link one dashboard to another dashboard. Perhaps it would make sense to have "fruits" and "car models" have different dashboards, which could be linked to a "parent" dashboard which used the drilldowns to navigate to the appropriate one. For more information, see: Make dashboards interactive | Kibana Guide [7.13] | Elastic

Hi Patrick, thank you for your reply.

Maybe the "cars" and "fruits" example wasn't that good! The real example: A pie chart which shows the proportions of answers from various questions in a questionnaire. I would like the visualisation to remain invisible until the user selects the specific question they're interested in. Without the filter, the chart would be very messy (e.g. 100 answers to display).
I have tried the nested visualisation but the same "messiness" occurs.

But as you say this doesn't seem possible so maybe a different dashboard structure (e.g. parent-child as you suggest) may be the way to go.
Someone also suggested using iFrame, with some conditional scripts, but I haven't figured out that one.
Thanks again, I will check out the link