Change Chart dataseries visibility on Click

I'm looking to turn on and off the visibility of certain dataseries in a chart using the click handler of a statistic and have not been able to resolve this issue with GPT or other discussion topics. Any suggestions would be greatly appreciated.

I have a number of statistic boxes (statistic5 - statistic10) and would like for the click handler on each of them to turn on the visibility of certain dataseries in a chart (chart18) but I can't get any queries or transformers to impact the dataseries visibly. Is it not as simple as a script like this table18.dataseries[4].visible=true?

You should look to change the data source of the chart, not try to directly adjust it once rendered as these are readOnly properties.
The chart is simply there to display the data its provided with, so the best way to change what's displayed is to change its data.

What's the data source of your chart? You should be able to adjust the visibility (or remove completely) the clicked items using a transformer or query and use that data to drive the chart.

Thank you. That makes sense. So, if I've created multiple data sources that only show a particular data set in each (channels_orgsea_leads and channels_orgsea_customers) but I haven't quite found the proper query or transformer that will change these datasets in the chart.

@Justin_Fuqua what kind of component are the charts displayed on?

Could you share a screenshot of the app and where you would like to click to toggle what the chart is showing?

Components have a hidden property to hide the entire thing, but it sounds like you are showing a bunch of data and want to selectively "peel off" layers via clicks. Is that accurate?

I ended up using a container with multiview and had the onClick switch view key and run a query for that specific chart in the view.