Question:
In an E3Chart that is plotting historic data, how can I set up automatically the limits of the X axis according to E3TimeStamp‘s first and last value?
Solution:
To do so, follow these procedures:
1) Set up a query in E3Chart that retrieves the first and last value of E3TimeStamp.
Example:
FROM Historic
NOTE: In this example, “Query2” was set up specifically to retrieve these values. However, this could have been set in the same query searching for data to be plotted.
2) Set a script in OnStartRunning event of the screen where E3Chart is by using GetADORecordset() function to retrieve the values returned by the query, as well as to set the limits of the chart’s X axis.
The script looks like this:
Set Chart = Screen.Item(“E3Chart1”)
Set Query = Chart.Item(“Query1”)
Set rs = Query.GetADORecordset()
‘ Attribution of values to X axis
Screen.Item(“E3Chart1”).HorScaleBegin = rs.Fields(0).Value
Screen.Item(“E3Chart1”).HorScaleEnd = rs.Fields(1).Value