Ezchart pen disable script

Script only disables the last row. All other rows previous does not disable. If more tags are selected, same thing happens, only the highest row pen disables. Row count prints out contiguous from 0-n.

table = event.source.parent.getComponent("ezchart") for row in range(table.tagPens.rowCount): newdata = system.dataset.setValue(table.tagPens, row, "ENABLED", 0) print row table.tagPens=newdata ezchart=table

Hard to tell what you have going on without indentation, but this works for me:

table = event.source.parent.getComponent("ezchart") olddata=table.tagPens for row in range(table.tagPens.rowCount): newdata = system.dataset.setValue(olddata, row, "ENABLED", 0) print row table.tagPens=newdata olddata=newdata
I used one more copy of the dataset. After writing to the ezchart, I copy the modified dataset into the old set. That keeps it internal to the script.

Hope this helps!

Thank you, it works. Now I see what I did wrong.