Hello there everyone,
I have been trying and I was wondering if it could be possible for the data displayed on a Power Chart to change depending of the selected option on a Dropdown Menu. The view design would be the following:
As it can be seen, there's only a dropdown menu and a Power Chart component. The Dropdown Menu has the following configurations:
The idea I am trying to implement is a Change Script on the "value" option of the Dropdown menu, so when the value changes, so will the data on the powerchart, along the Pen name displayed. Here's what I'm trying to do, using every historic path tag on the chart.props.pens.data.source expresion:
def valueChanged(self, previousValue, currentValue, origin, missedEvents):
selected = currentValue.value
chart = self.getSibling("PowerChart")
SUM_FIT_01 = "histprov:SQLServer:/drv:ignition-XXX-XX:default:/tag:derived tags/sum_fit_01_mins"
#Same goes for the rest of tags
if selected == 0:
chart.props.pens.data.source = SUM_FIT_01
chart.props.pens.name = "A"
elif selected == 1:
chart.props.pens.data.source = SUM_FIT_02
chart.props.pens.name = "B"
elif selected == 2:
chart.props.pens.data.source = SUM_FIT_04
chart.props.pens.name = "C"
elif selected == 3:
chart.props.pens.data.source = SUM_CC_01
chart.props.pens.name = "D"
elif selected == 4:
chart.props.pens.data.source = SUM_DP_01
chart.props.pens.name = "E"
elif selected == 5:
chart.props.pens.data.source = MEAN_CLIT_01
chart.props.pens.name = "F"
elif selected == 6:
chart.props.pens.data.source = MEAN_OIT_01
chart.props.pens.name = "G"
When trying to run the application, this message error appears:
How could I solvent this problem in order to work? Thanks in advanced