Enable/Disable pens in script

I am using the Easy Chart with a pens table that has about 900 pens defined. I then manage groups of pens that can be loaded by changing the charts ‘Pens’ query binding. Some of these groups have several pens.

A request was made to have all pens disabled when loading the chart and let them determine which pens to show. This was accopmplised by setting the ‘enabled’ field to 0 for all pens in the table. Well some users want to show all pens from the beginning and turn off the ones they don’t care about.

My thought is to add a check box that would either turn on or off all pens in the Pens dataset. I can’t do this at the table level because it will affect all users.
The Pens binding is set to ‘polling off’

As a test I tried the following to change the first point:

dsPens = event.source.parent.getComponent('Chart').pens firstItem = dsPens.getValueAt(0,6) # column 6 is the enabled column print firstItem dsPens.setValueAt(0, 6, 1)
This does change the value in the dataset but it is not reflected on the chart. Is there a way to cause the chart to refresh from the dataset? I tried the refresh method but that refreshes the query binding.

Also, if this is the wrong approach I am open to other solutions.

Thank you,

Using setValueAt is not supported. Here would be the proper way to do what your code is attempting:

dsPens = event.source.parent.getComponent('Chart').pens firstItem = dsPens.getValueAt(0,6) # column 6 is the enabled column print firstItem dsPens = fpmi.dataset.setValue(dsPens, 0, 6, 1) event.source.parent.getComponent('Chart').pens=dsPens

Thanks Carl,

I was so focused on getting setValueAt to work that I started programming with blinders on.

Thank you!

No problem!