EasyChart timespan

If the OP really wants this feature, the simplest solution I can come up with is an overlay. Simply put a container over the easy chart's spinner and dropdown, and then, put a replacement spinner and dropdown in the container:
image
The overlaid dropdown can have Months and Years as the selection options.

To make the overlaid spinner and dropdown work, add the following custom method to the easy chart:

#def setRealTimeRange(self):
	self.unit = 86400 #This sets the realTime unit to days
	#===========================
	#if needed, change the following two relative paths for the spinner and dropdown components
	selectedUnit = self.parent.getComponent('Container').getComponent('Dropdown').selectedLabel
	numberOfUnits = self.parent.getComponent('Container').getComponent('Spinner').intValue
	#===========================
	numberOfDays = 0
	daysPerMonth = 30
	daysPerYear = 365
	if selectedUnit == 'Months':
		numberOfDays = daysPerMonth * numberOfUnits
	elif selectedUnit == 'Years':
		numberOfDays = daysPerYear * numberOfUnits
	self.unitCount = numberOfDays

Call the custom method from the spinner with this propertyChange event script:

if event.propertyName == 'intValue':
	#Change relative chart path as needed
	event.source.parent.parent.getComponent('Easy Chart').setRealTimeRange()

...and call the call the custom method from the dropdown with the following propertyChange event script:

if event.propertyName == 'selectedLabel':
	#Change relative chart path as needed
	event.source.parent.parent.getComponent('Easy Chart').setRealTimeRange()
1 Like