Scripting Easy Chart - changing default style when dragging pens (addPen vs chart configuration dataset)

Hi everyone,

I am trying to figure out a way to change the default when dragging a tag onto an easy chart from tag browser. I am under the impression I should be able to accomplish this by editing the dataset before loading it into the chart configuration properties of the ‘easy chart’ component.

However, while looking over the ignition demo project I noticed they used a different method

self.parent.addPen(selectedPath, tagPath, tapProvider, 3)
(I have tried looking for any details of this in manual but could not seem to find anything regarding what it is, the parameters it uses etc… )

Is there a different way to add pens besides editing the dataset under chart configuration?

I don’t have the demo project in front of me at the moment, but that sounds like a custom function; try right-clicking on the container that that easy chart is on, and selecting “Scripting”. You’re likely to see a custom function that’s been pre-configured for the demo project. Modifying the tag pens dataset is the best way of adding the pen (unless you’re fine with the default setup, in which case you shouldn’t need to write any script at all when dragging from a tag browse tree).

Thanks,

You were right the container itself had custom function ‘addPen’. In the function they are modifying the dataset as expected.

For my case I just need to modify this custom method to my needs.