Hide legend and filter multiple time series from one legend

What Grafana version and what operating system are you using?

  • Grafana version: Grafana v9.3.6 (978237e7cb)
  • Operating system: Windows
  • Browser: Chrome

What are you trying to achieve?
I have a panel like this

My MYSQL query returns the moisture, CC, PMP and UC given a sensor. So each moisture time series has a CC, PMP and UC time series.

I want to be able to filter by clicking on the name of the legend the moisture, CC, PMP and UC data of that sensor. And I want only the legends for moisture to appear. The legend CC, PMP and UC want to hide.

I want something like this:

Is it possible to do that? Please help.