How to make a radio button filter my chart or table?

I would like to know how to make the radio button selection filter the chart or table, does anyone have an idea?

The first question is where is the data on the chart or table coming from?

For instance, if it's from a database, filtering in the database query is going to be vastly more efficient than filtering "client" side via a script or expression.