I am wondering how I can disable any click+drag action on an Easy Chart, as well as disabling the menu that pops up when you right click on it. I don’t want the chart to modified in those ways. Preferably, nothing would happen.
self.setPopupMenu(None)
self.setTransferHandler(None)
Should work; place in configureChart
. You may have issues in the designer, because toggling into preview mode doesn’t fire configureChart
, but does fire a locale event that recreates the popup menu; but in the actual client that should work fine.
Nothing happens in the client, and this is what shows up in the client console:
10:10:26.889 [AWT-EventQueue-0] ERROR Vision.EasyChart - Error invoking extension method.
org.python.core.PyException: Traceback (most recent call last):
File "", line 11, in configureChart
AttributeError: 'com.inductiveautomation.factorypmi.application.com' object has no attribute 'setPopupMenu'
Huh, that’s pretty weird. What version of Ignition are you using? I copied those directly out of my designer where they were working…
Can you print type(self)
before the self.setPopupMenu()
call?
v8.0.11 and I just tried v8.0.12
<type 'com.inductiveautomation.factorypmi.application.components.PMIEasyChart'>
I was able to get this to work for the right-click popup
self.getComponent(0).getComponent(0).setPopupMenu(None)
Any other ideas for disabling the zoom? I tried ‘setTransferHandler’ on every component in the EasyChart. I also tried
self.getComponent(0).getComponent(0).setMouseZoomable(False)
self.getComponent(0).getComponent(0).setRangeZoomable(False)
self.getComponent(0).getComponent(0).setDomainZoomable(False)
but nothing seemed to work.
to disable pop up you can use
self.setShowPopup(0) on configureChart, please refer PMIEasyChart (ignition 7.8.4-rc1 API) for more