Chart Mode via scripting?

I’ve been looking in the documentation but i cant seem to find the way to do this. Basically in a chart when right clicking we get a popup menu that allows us to change the ‘mode’ or functioning of the mouse. Is there a way to change this via script? It appears it is a property we should be able to change easily but I have no idea where it is.

Thanks in advance to anyone who has some insight in this !

The Easy Chart has a built-in setMode function: Easy Chart Appendix Page

Additionally, this forum post has some useful examples.

Thanks for the response. !

I was using the chart component and not the easy chart. I 've seen it has definetly more built in functions easy chart and I’ll try to incorporate it instead of a normal chart. However my doubt remains, in the chart component is there a way to change the functioning mode ? Easy chart is too tag related and so I find it difficult to plot some other data consistently.

Ok, I’ve found the solution. A chart (not easy chart) is a PMI Chart which inherits the properties of a PMILineChartPanel. This class has a mode property so by jyst retrieving the chart component we can set the mode easily with any of the valid integers. I.E.:

table = event.source.parent.parent.getComponent('TABLE NAME')
table.mode = 3

Such a simple solution but well, now it’s clear for anyone who can ask themselves the same question.

2 Likes

I noticed something tho, might be a bug but if you setMode to say X-Trace on window open, it will be set on X-trace but if you right click and select Mode it shows “Zoom” being selected so to get zoom you have to select some other Mode first then select zoom again. is this just happening to me?

I see this issue also…

Good to see I’m not alone. It’s not a huge deal but it be great if they can fix it. it gets annoying especially when you are trying to show stuff to people

What version are you on? In Ignition 7.9.5 I add a setMode() to the visionWindowOpened event handler, and when I open my popup window it’s in the proper mode on the popup menu:

maybe it’s fixed then, I’m on 7.9.4

I too tested it in version 7.9.5 and this bug doesnt appear. It seems it was effectively fixed in the update.