# EasyChart timespan

**URL:** <https://forum.inductiveautomation.com/t/easychart-timespan/76679>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [July 20, 2023, 7:13pm UTC](https://forum.inductiveautomation.com/t/easychart-timespan/76679 "2023-07-20T19:13:24Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [July 22, 2023, 3:51am UTC](https://forum.inductiveautomation.com/t/easychart-timespan/76679/12 "2023-07-22T03:51:18Z")

</div>

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](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/e/3ede6ab709efa753b79ea30e84bdad717db9cd15.png)  
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:

```auto
#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:

```auto
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:

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

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/easychart-timespan/76679)._
