# Get Chart (not Easy Chart) mode in script

**URL:** <https://forum.inductiveautomation.com/t/get-chart-not-easy-chart-mode-in-script/35662>\
**Category:** Ignition\
**Created:** [June 15, 2020, 4:25pm UTC](https://forum.inductiveautomation.com/t/get-chart-not-easy-chart-mode-in-script/35662 "2020-06-15T16:25:27Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![klpe](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@klpe](https://forum.inductiveautomation.com/u/klpe)\
**Post date:** [October 10, 2022, 12:38pm UTC](https://forum.inductiveautomation.com/t/get-chart-not-easy-chart-mode-in-script/35662/11 "2022-10-10T12:38:23Z")

</div>

I put the code below in mouseReleased and now I can detect if zoom is selected. The timing is off, I check before the popup is opened, and I need to loop over the rest of the radiobuttons, but I think I'm on the right track.

```auto
from org.jfree.chart import ChartPanel, JFreeChart
from org.jfree.chart.plot import Plot

def findJFChart(src):
	"""IA's EasyChart and XYPlot components have their JFreeChart objects at different positions 
	in the Container/Component hierarchy. This helper function scans the hierarchy, given a container or 
	component as a starting point, and returns a tuple containing the parent JFreeChartPanel and 
	the targeted JFreeChart. Note: The hierarchy is searched depth-first! """  
	#from app.scriptmodule import findJFChart 
	try: 
		return (src, src.chart) 
	except: pass 
	try: 
		for x in range(src.componentCount): 
			try: return findJFChart(src.getComponent(x)) 
			except: pass 
	except: pass 
	raise ValueError, "Unable to Find a JFreeChart Instance"

if event.popupTrigger == 1:
	print "Popup triggered!"
	chart = event.source #parent.getComponent("Easy Chart")
	ch = findJFChart(chart)
	print(str(ch[0].getPopupMenu().getSubElements()[0].getComponent().getItem(0).isSelected()))
	

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/get-chart-not-easy-chart-mode-in-script/35662)._
