0

Trend Chart Start Time Control

If I have multiple trend charts on a screen, is it possible to connect all of them to a single Date/Time picker so all the charts always show the same time range? 

3 replies

null
    • smason
    • 1 yr ago
    • Reported - view

    Hi ltorack ,

    Here is a script that you can use to update the TimeStart of all trend charts on the screen:

            public void DateTimePicker1_OnDateTimeChange(object sender, DateTime dateTime)
            {
                List<ControlTrendGraph> listOfTrendGraphs = _screen.Descendants<ControlTrendGraph> (false).ToList();
    
                foreach (ControlTrendGraph trendGraph in listOfTrendGraphs )
                {
                trendGraph.TimeStart = dateTime;
                }
            }
    

    You can simply replace TimeStart with TimeEnd if you would rather update the live edge date/time.

    ***Note, we found a bug in this process as all trend graphs are not exact. They may differ by a few seconds. Hopefully this is sufficient enough until we can fix it.

    • ltorack
    • 1 yr ago
    • Reported - view

    Thank you, Steve Mason ! This worked well for my screen that didn't have any panels, but when I tried to use the same code on a different screen where all the trend graphs were inside a panel, they didn't update when the date was changed. How would I change this script to specify to update all the trend graphs in a specific panel?

      • smason
      • 1 yr ago
      • Reported - view

      ltorack 

      I think if you change "false" to "true", that will also update any trend graphs embedded in a panel.

      (true).ToList();
      

      Let me know if that works.

Content aside

print this pagePrint this page
  • 1 yr agoLast active
  • 3Replies
  • 75Views
  • 2 Following