If I override the right-click context menu on an Easy Chart using system.gui.createPopupMenu, is there a way to perform the reset axes, zooms, etc from the original context menu via scripting? The only thing I know how to do is use setMode to change between Zoom, Pan, X-Trace, etc.
#in mouseReleased event handler
def setXTrace(event=event):
event.source.setMode(4)
def setZoom(event=event):
event.source.setMode(0)
def setPan(event=event):
event.source.setMode(1)
def resetAxes(event=event):
print "how do I do this?"
#right click only
if event.button == 3:
menuDict = {}
menuDict["Zoom Mode"] = setZoom
menuDict["X-Trace Mode"] = setXTrace
menuDict["Pan Mode"] = setPan
menuDict["Reset Axes"] = resetAxes
menu = system.gui.createPopupMenu(menuDict)
menu.show(event)
Right, I am sorry. That function doesn’t exist on the easy chart. It doesn’t look like we have a public reset axes function. You can try event.source.initialize().
No problem, thanks for getting back to me. It would be great if those functions could be exposed, though.
I think I can toggle a value on the chart (like autoApply) off and on which will cause the graph to reset. The only catch is all the queries will refresh.