There are many ways to do this. Try this:
Set HidePrefix = '%';
Load * InLine [
In the above script replace ChartDim 1 & 2 with the names of your dimension fields.
Create a listbox on field %ChartDim. Select one value then in properties set to One Selected Value Only. Set the style to LED and if you want de-select Single Column if you want to display horizontally.
In your chart replace your dimensions with this single calculated dimension:
Now when you change your selection in the listbox the dimension in the chart will change to the one you pick.
But don't works if we select Dim1 and Dim2. Is there a way to allow that with adapting your solution??
Because i often use conditionnal hiding dimension/expression with using Concat and SubStringCount (Customizable Straight Table)
And if you have a big number of dimensions, it can be long because you have to go in properties and write formulas for each of them.