I wasn’t sure how to describe the component I’m inquiring about in the subject so I attached an image. Is there any way to link this title to a tag? I had trouble finding where this property is defined.
Thanks in advance.
I wasn’t sure how to describe the component I’m inquiring about in the subject so I attached an image. Is there any way to link this title to a tag? I had trouble finding where this property is defined.
Thanks in advance.
I don’t believe it’s easy to bind it, but I can at least point out where it comes from: Each pen can belong to a “group”. The groups define how the pens get broken up over there. If you go to the chart customizer (where the pens are defined), select a pen and hit “Edit”, you should see the group setting for the particular pen. You can change them to fit what you want.
Hope that helps,
It depends on what you’re trying to do. Here’s what you can do with Easy Charts:
Alternatively, you could also edit the group names via Script.
I would simply alter the group name in the pens dataset via a script.
An old trick comes up again! Create a dynamic property, bind that property to your driving tag/expression, then run the script on a value change.
For example:
if event.propertyName=='label': #our dynamic property changed
chart=event.source.getComponent('Easy Chart')
row=0 #target pen (row in dataSet)
#Set the chart's 'pens' dataSet to a new one
#after modifying the GROUP_NAME property at row 0
chart.pens=fpmi.dataset.setValue(chart.pens, row, "GROUP_NAME", event.newValue)
*note: you will need to loop through each pen with the same group name
Thank you all for your suggestions. Nathan, I will be using your scripting approach. However, I am receiving the following error when my script is executed
Traceback (innermost last):
File “event:propertyChange”, line 14, in ?
AttributeError: instance of ‘com.inductiveautomation.factorypmi.application.script.BuiltinPackage’ has no attribute ‘dataset’
which is referring to:
chart.pens=fpmi.dataset.setValue(chart.pens, row, "GROUP_NAME", event.newValue)
Is this dataset module a version 3.3 update?
Yep. You can find the change log here: inductiveautomation.com/supp ... FactoryPMI
Its the fifth entry down from the top.
Ok! The scripting approached worked well. I used the following approach to loop through the rows of the ‘pens’ dataset, in case anyone was going to be taking the same route as I.
if event.propertyName=='penLabel': #our dynamic property changed
chart=event.source.getComponent('Easy Chart')
data = fpmi.dataset.toPyDataSet(chart.pens)
i=0
for n in data:
chart.pens=fpmi.dataset.setValue(chart.pens, i, "GROUP_NAME", event.newValue)
i=i+1