Switching between datasets for chart with scripting


I having a box and whisker chart and a parameter power table. In the power table can I select a parameter. I want to switch between the dataset depending on the selected parameter in the power table. The datasets and the selected parameters are custom properties.

I used this script what i run in the property change of the box and whisker chart:

if event.source.parent.Selectedparameter == ‘Perstijd’:
event.source.data = event.source.parent.Perstijd

if event.source.parent.Selectedparameter == ‘Persdruk’:
event.source.data = event.source.parent.Persdruk

When I selected a different parameter the dataset of the box and whisker chart will not change. Can somebody see what I am doing wrong?


You need to define your property change event on the object and property that triggers the others–the selection on the power table. Or on the container of your box-and-whisker chart where the Selectedparameter property is located. The chart is a consumer of the changes, not the source.

Thanks you it worked!