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?
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.
Agree. that much data is hard on ignition. I would recommend no more then 30 days at a time.
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:
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.
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.
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.
Please post the tag history settings for your test tag.
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.)
Is this system a production system with large number of tags, historization, scripting client and server side? Curious about your setup.
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.
Thanks for sharing your setup information. Great forum post, just another great example of the power of Ignition.
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:
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()
This works great! Thank you!!