EasyChart TagPens dataset Script Structure

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.

Thank you

To be specific, it is of type com.inductiveautomation.ignition.common.BasicDataset.

I'm not sure how that information is useful to you.

This thread, on the other hand may be:

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:

easyChart = event.source.parent.getComponent('Easy Chart')
penName = 'Test Pen'
color = system.gui.color('blue')
componentScripts.setPenColor(easyChart, penName, color)