TimeOffset - property of the tvPoints object
Description:
The time of each point in the buffer with points of the
tvPoints object is increased by the value set in this property (either read from the trends server or 'manually' defined by the
AddPoints method) and the trend progress is then drawn in these calculated time intervals (it is possible to move the whole curve on the time axis).
Syntax:
Double TimeOffset
Note:
Property access
for read and write.
This property is also functional in
Web panels.
The default value is
0.
Example:
The definition of the curve only by relative time intervals, displaying the curve in the real time is achieved by the offset definition in TimeOffset.
JavaScriptVBScriptSelect and copy to clipboard
var oTView = pMe.Items("../TrendView");
var oPoints = oTView.Trends("t1").Points;
var tNow = Pm.Time;
var vTimes = Pm.Array1(tNow-6/24, tNow-5/24, tNow-4/24, tNow-3/24, tNow-2/24, tNow-1/24);
var vValues = Pm.Array1(60, 40, 70, 50, 10, 80);
oTView.TimeSetType = 1;
if (oPoints)
{
oPoints.AddPoints(vTimes, vValues, 0, 0);
// Moving the whole curve into the current time minus one day.
oPoints.TimeOffset = tNow - 1;
oTView.Draw();
}
Dim oTView, oPoints, tNow, vTimes, vValues
Set oTView = pMe.Items("../TrendView")
Set oPoints = oTView.Trends("t1").Points
tNow = Pm.Time
vTimes = Pm.Array1(tNow-6/24, tNow-5/24, tNow-4/24, tNow-3/24, tNow-2/24, tNow-1/24)
vValues = Pm.Array1(60, 40, 70, 50, 10, 80)
oTView.TimeSetType = 1
If Not oPoints Is Nothing Then
oPoints.AddPoints vTimes, vValues, 0, 0
' Moving the whole curve into the current time minus one day.
oPoints.TimeOffset = tNow - 1
oTView.Draw
End If