I am trying to write a script that will change the color of the pen when the button is clicked. I am trying to push the value of the color into the Tagpens data set however I am not sure what datatype the dataset is.
If anyone has any thoughts or additions please drop them here.
A simple function could be created for this and put in either a custom method or a library script:
# Gets the tag pens dataset for a given easy chart,
# ...finds the appropriate row for a given tag number,
# ...and changes the color property
def setPenColor(easyChart, penName, color):
dataset = easyChart.tagPens
for row in xrange(dataset.rowCount):
if dataset.getValueAt(row, 'NAME') == penName:
easyChart.tagPens = system.dataset.setValue(dataset, row, 'COLOR', color)
break
If the function were in a library script called componentScripts, it would be called like this: