Easy Chart X Value

When I called support they mentioned I could get the timestamp value (X-Axis) of where the mouse was clicked on an Easy Chart. Anybody know what the command was for use in a script?

It is available on the classic chart not the easy chart.

Was the command selectedXValue?

I was able to get the date from both charts. However the value is blank when clicking on a subplot graph. I also have to click twice to get the correct value to display. What is the proper way to use this feature?

Hello jaepark, how did you get the date from the easy chart?

The NoteChart and EasyNoteChart components in the NoteChart Module has expanded functionality for XTrace mode, suitable for Time-Series data, where the X-axis value of an XTrace is made available as an actual (writable) java.util.Date property.

It seems reasonable to add the effective datetime value corresponding to the mouse position of any mouse event to an expanded event object, whether in XTrace mode or not. I’ll add this to my to-do list.

Well. That was easy. Y’all can try this beta NoteChart module containing a ‘domainTS’ property on all mouse events.

I’ll start running it through my testbed and updating the documentation.

1 Like

Add this to your Easy Chart mouseReleased event handler:

from org.jfree.chart import ChartMouseListener

class myChartMouseListener(ChartMouseListener):
	def chartMouseMoved(self, cme):
		pass
	
	def chartMouseClicked(self, cme):
		chartEntity = cme.getEntity()
		
		if chartEntity is not None:
			epochLong = chartEntity.getDataset().getX(chartEntity.getSeriesIndex(),  chartEntity.getItem()).longValue()
			system.gui.messageBox(str(system.date.fromMillis(epochLong)))		

		chart = event.source.parent.getComponent('Easy Chart').getComponent(0).getComponent(0)
		chart.removeChartMouseListener(self)

chart = event.source.parent.getComponent('Easy Chart').getComponent(0).getComponent(0)
chart.addChartMouseListener(myChartMouseListener())