# 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:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yurie\_Han](https://avatars.discourse-cdn.com/v4/letter/y/8c91f0/32.png) [@Yurie\_Han](https://forum.inductiveautomation.com/u/Yurie_Han)\
**Post date:** [July 20, 2023, 7:13pm UTC](https://forum.inductiveautomation.com/t/easychart-timespan/76679/1 "2023-07-20T19:13:24Z")

</div>

Hello,  
I'm using EasyCharts in realtime mode, and I was wondering how I could modify them to add months and years to the dropdown list for the timespan, as well as remove seconds, minutes, and days?

---

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [July 20, 2023, 11:29pm UTC](https://forum.inductiveautomation.com/t/easychart-timespan/76679/2 "2023-07-20T23:29:45Z")

</div>

I would proceed with caution giving users the ability to select months and years to pull data. I think you will find that doing so will crash your vision client.

---

<div class="post-metadata">

**Author:** ![earnhartj84](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/earnhartj84/32/29405_2.png) [@earnhartj84](https://forum.inductiveautomation.com/u/earnhartj84)\
**Post date:** [July 21, 2023, 4:22pm UTC](https://forum.inductiveautomation.com/t/easychart-timespan/76679/3 "2023-07-21T16:22:36Z")

</div>

Agree. that much data is hard on ignition. I would recommend no more then 30 days at a time.

---

<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, 1:18am UTC](https://forum.inductiveautomation.com/t/easychart-timespan/76679/4 "2023-07-22T01:18:04Z")

</div>

Just out of a morbid curiosity, I put an easy chart with an old test tag into the designer to see how trending three years worth of data would look in real time:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/6/a625b5faf02a647d02ec65086ae3b0a9ec10e894.png)

To my complete surprise, it works. It loaded within seconds, and when I navigated the data it wasn't laggy. Furthermore, it didn't freeze up even when I used the different modes: zoom, pan, mark, and xTrace. While I can't think of an application where I would want to look at this much data at once, I can say that if somebody wanted to, it's feasible to do it.

---

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [July 22, 2023, 1:46am UTC](https://forum.inductiveautomation.com/t/easychart-timespan/76679/5 "2023-07-22T01:46:53Z")

</div>

I would like to see the historical settings on that tag. Deadband, storage frequency, etc. I would assume that it is pulling a rather small number of records from the database, and interpolating across them.

---

<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, 2:05am UTC](https://forum.inductiveautomation.com/t/easychart-timespan/76679/6 "2023-07-22T02:05:25Z")

</div>

> [@franklepkowski](#):
>
> I would assume that it is pulling a rather small number of records

Your assumptions are wrong. The tag records its value at a rate of 30 times per minute. It was a legit performance challenge, and I was pleasantly surprised at the result.

---

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [July 22, 2023, 2:09am UTC](https://forum.inductiveautomation.com/t/easychart-timespan/76679/7 "2023-07-22T02:09:50Z")

</div>

Please post the tag history settings for your test tag.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 22, 2023, 2:10am UTC](https://forum.inductiveautomation.com/t/easychart-timespan/76679/8 "2023-07-22T02:10:26Z")

</div>

Vision's charts can handle enormous amounts of data, if 1) you can get it there before a query times out, and 2) you don't fill up all of the client process' RAM.

My Time Series Database Cache module exists to deal with #1, and to reduce the chance of #2.

It was created to deal with a client recording thousands of points at 100ms intervals, and wanting to review many days or multiple weeks at a time. (Tens of millions of rows, worst case.)

---

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [July 22, 2023, 2:13am UTC](https://forum.inductiveautomation.com/t/easychart-timespan/76679/9 "2023-07-22T02:13:05Z")

</div>

Is this system a production system with large number of tags, historization, scripting client and server side? Curious about your setup.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 22, 2023, 3:26am UTC](https://forum.inductiveautomation.com/t/easychart-timespan/76679/10 "2023-07-22T03:26:25Z")

</div>

We run a production system with well over 100k tags. Using an easy chart it is not unusual for us to pull history for months of data at a time across 15-20 tags at once. The majority of our tags are configure for storing on change with no max timespan, due to the nature of our processes.

I will say that the majority of our clients run on laptops with plenty of system RAM available, however, I have never seen a client crash due to the amount of history being displayed.

We also don’t use realtime mode.

All that being said, I would agree with the sentiment to proceed with caution. There is a reason that months and years aren’t available by default in that mode.

---

<div class="post-metadata">

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

</div>

Thanks for sharing your setup information. Great forum post, just another great example of the power of Ignition.

Regards,

Frank

---

<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()

```

---

<div class="post-metadata">

**Author:** ![Yurie\_Han](https://avatars.discourse-cdn.com/v4/letter/y/8c91f0/32.png) [@Yurie\_Han](https://forum.inductiveautomation.com/u/Yurie_Han)\
**Post date:** [July 24, 2023, 2:00pm UTC](https://forum.inductiveautomation.com/t/easychart-timespan/76679/13 "2023-07-24T14:00:34Z")

</div>

This works great! Thank you!!
