Trend X-Trace mode

The first thing I do when I view a trend is change to X-Trace mode. Is there a way to enable the X-Trace mode on a chart through scripting so it’s there automatically there on open? I can’t find the correct attribute.


How may I ask did you figure that out?

From this earlier post…

[quote=“JordanCClark”]From this earlier post…[/quote]
Ok, because I didn’t see that in the user manual :/

Hi guys,

I am new to Ignition and would like to implement this.

I tried putting “event.source.setMode(4)” inside the easy chart’s scripting (under Extension Functions->configureChart) but nothing seems to happen…



The command isn’t literally “event.source.setMode(4)”. It needs your event and your source. For example, below is part of the script I run when a window with a trend object opens to set the X-Trace mode. Click on the “Insert Property Reference” button to have it build the expression for you.

I’ve never tried it, but adding the script to the chart’s Extension Functions->configureChart like you’re trying to do should work too.

chart = system.gui.getParentWindow(event).getComponentForPath(‘Root Container.Easy Chart’)

Thank you AE2S_Sanden!

Hi again,

I would like to use a multi-state button for selecting the mode.

I have put this code into the Multi-Start Button’s Component Scripting -> Property Change:

chart = system.gui.getParentWindow(event).getComponentForPath(‘Root Container.Easy Chart’)
if “Building 3/DI Water/Trend/Chart Mode 2” == 0:
elif “Building 3/DI Water/Trend/Chart Mode 2” == 1:
elif “Building 3/DI Water/Trend/Chart Mode 2” == 3:
elif “Building 3/DI Water/Trend/Chart Mode 2” == 4:

Unfortunately, nothing seems to happen. Any help would be appreciated!



if event.propertyName == 'controlValue':
  chart = event.source.parent.getComponent('Easy Chart')

Hi JordanCClark,

You got me on the right track - I tried your code but was getting an error. This worked for me:

chart = system.gui.getParentWindow(event).getComponentForPath(‘Root Container.Easy Chart’)


1 Like