Status Chart polling mode

Hi, we are using Status Chart in the vision module to display different state of running equipement. We want to link the polling mode time trigger with an outside tag (refresh general timing tag). Is there a way to link this feature with the Status Chart.
Also is there any event handler script to monitor if a zoom-in has been done by the client. I found the normal : Mouse click and Mouse Exit, but not found a specific script to monitor when this action has been done and undone. Thank you for the support.

Interesting question. I believe polling rates for a status chart are usually set as a fixed value when the tag history binding is set up. I know it can be set relative to the projects base rate, but I'd be interested in knowing if it can be dynamically changed.
image

I imagine that listeners will have to be added to the domain and range axes of the chart to get this information. A listener should only be added once, so the parent window's internalFrameOpened event handler is probably the best place to script something like that in most cases.

Here is an example script that would accomplish this for your usage case:

from org.jfree.chart.event import AxisChangeListener

#This path will need to be changed if the chart is nested, or if the chart has a custom name
chart = system.gui.getParentWindow(event).getComponentForPath('Root Container.Status Chart').chart

plot = chart.XYPlot
rangeAxis = plot.rangeAxis
domainAxis = plot.domainAxis
class rangeZoomListener(AxisChangeListener):
	def __init__(self, axis):
		self.axis = axis
		self.originalValue = axis.getRange()
		self.oldValue = axis.getRange()
	def axisChanged(self, event):
		newValue = self.axis.getRange()
		#Do whatever you want to with the following information
		print 'event = rangeAxisChanged'
		print 'originalValue = ' + str(self.originalValue)
		print 'oldValue = ' + str(self.oldValue)
		print 'newValue = ' + str(newValue)
		print
		self.oldValue = newValue
class domainZoomListener(AxisChangeListener):
	def __init__(self, axis):
		self.axis = axis
		self.originalValue = axis.getRange()
		self.oldValue = axis.getRange()
	def axisChanged(self, event):
		newValue = self.axis.getRange()
		#Do whatever you want to with the following information
		print 'event = domainAxisChanged'
		print 'originalValue = ' + str(self.originalValue)
		print 'oldValue = ' + str(self.oldValue)
		print 'newValue = ' + str(newValue)
		print
		self.oldValue = newValue
rangeListener = rangeZoomListener(rangeAxis)
domainListener = domainZoomListener(domainAxis)
rangeAxis.addChangeListener(rangeListener)
domainAxis.addChangeListener(domainListener)

Output on initial zoom:

event = domainAxisChanged
originalValue = Range[-0.5,2.5]
oldValue = Range[-0.5,2.5]
newValue = Range[0.15407301223105951,1.6045117412279852]

event = rangeAxisChanged
originalValue = [Oct 14, 2008, 1:12:00 PM --> Oct 24, 2008, 10:48:00 AM]
oldValue = [Oct 14, 2008, 1:12:00 PM --> Oct 24, 2008, 10:48:00 AM]
newValue = [Oct 17, 2008, 1:08:24 PM --> Oct 21, 2008, 10:12:00 AM]

Output on unZoom:

event = domainAxisChanged
originalValue = Range[-0.5,2.5]
oldValue = Range[0.15407301223105951,1.6045117412279852]
newValue = Range[-0.5,2.5]

event = rangeAxisChanged
originalValue = [Oct 14, 2008, 1:12:00 PM --> Oct 24, 2008, 10:48:00 AM]
oldValue = [Oct 17, 2008, 1:08:24 PM --> Oct 21, 2008, 10:12:00 AM]
newValue = [Oct 14, 2008, 1:12:00 PM --> Oct 24, 2008, 10:48:00 AM]