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