Vision Ad hoc trend chart: Saving/Loading History and Realtime chart date and time settings

Hi all,

I am using the vision ad hoc trend chart tool that is posted on Ignition Exchange by @Travis.Cox

Here is a link to the tool: Ignition Exchange | Inductive Automation

I have configured a plot in historical mode and saved it using the “Save Graph” component. Then, I have cleared my pens and modified the start and end date. Next, I loaded the plot using the “Load Graph” component. I noticed that the original start and end date for the saved plot was not restored when I loaded the plot.

I checked the scripts under “Save Graph” and “Load Graph” components and noticed that only the tag pens and axes are being saved/loaded. I believe the solution to restore the date and times is to also save/load the following properties of the “Easy Chart” component as well:

1- Chart Mode
2- Start Date
3- End Date
4- Outer Range Start
5- Outer Range End
6- Unit Count
7- Unit

Has anyone attempted this? I would appreciate feedback or any updates I have to make to the scripts to solve this problem.

Example:

1- Saved a plot and called it “Test11”. Note that starting date is 4/1/21 12:27 PM and end date is 4/1/21 12:37 PM

2- I cleared the pens and modified the start and end date. Note that start date is 4/1/21 11:40 AM and end date is 4/1/21 11:50 AM

3- I loaded the plot I had saved as “Test11”. Note it did not restore the date and time I had it saved as (starting date 4/1/21 12:27 PM and end date 4/1/21 12:37 PM)

Thanks in advance!

Yes… I noticed this too. It doesn’t make a great deal of sense to save a trend over a period, annotate it and then not be able to retrieve it over the time period in question. I have a similar thread to do with the Perspective Ad Hoc Trend where it has the same issue.

Hopefully we are not alone and perhaps others have worked in a solution to this problem.

I haven’t done precisely this, but you should know that the time span properties will reject invalid values. So the order they must be applied varies depending on what’s already there. ):

So, to minimize the chance/impact of rejection, I recommend the following:

  • Set the chart mode first.
  • When switching into Realtime mode, check the existing unit. If changing to a larger unit, set the count first then the new unit. Otherwise set the unit first then the count.
  • When switching into Manual mode, set start and end dates, then set them again.
  • When switching into Historical mode, set outer start, start, end, and outer end, then set them again.

Don’t set properties that don’t apply to the new mode.

Hi everyone! I just uploaded a new version of the template that supports this functionality. You will see version 1.0.1:

It now stores the chart mode, dates, and units. It also loads it properly. Let me know if you have any additional questions.

Can you please do this update also for 7.9 version?

I updated version 1.0.1 of the resource to version 7.9.18. That way it will work for 7.9 and 8. Try it out and let me know.

Thank you @Travis.Cox and @pturmel for your time and help! Much appreciated