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? 

3replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • 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.

  • 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?

    • ltorack 

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


      Let me know if that works.

Like Follow
  • 3 wk agoLast active
  • 3Replies
  • 24Views
  • 2 Following