Promotic
WikipediaLinkedInYoutubeTwitterFacebook

AddPoints - method of object tvPoints

Description:

Add one data point or an array of data points into the internal buffer.

The vTimes time is expected according to setting the TrendsView.TimeSetType property, i.e. "local time", "standard time" or "daylight-saving time".

Syntax:
AddPoints(vTimes As Variant, vValues As Variant, vAttrs As Variant, nStyle As Long)
Calling:
oPoints.AddPoints vTimes, vValues, vAttrs, 0
Parameters:
vTimes(Variant) Single time value or time array in ascending order.
vValues(Variant) Single numeric (real) value or array of these values.
vAttrs(Variant) Not used, set the value 0.
nStyle(Long) The style how to add a data point (an array of points) into the tvPoints buffer:
0 - Add a point (an array of points) at the end of the buffer
1 - Delete the content of the buffer and add a point (an array of points)
4 - If the time period of points in the buffer and the time period (or only one time) of newly added points overlaps, keep all points in the buffer and add from new ones only those who don't overlap.
5 - If the time of some added points corresponds with the time of existing points, then the existing points will be kept and these new ones won't be added, others will be added on the corresponding time locations in the buffer of points.
Note:
This is relevant only for trends that are not connected to data source (to a variable in the PmTrend object).
See also:
Example1:
Time has to be entered in the "local time" (the "standard time" in the standard season and the "daylight-saving time" in the daylight-saving season.):
Dim vTimes, vValues, vAttrs, oPoints
oTView.TimeSetType = 1
Set oPoints = oTView.Trends("t1").Points
If Not oPoints Is Nothing Then
  oPoints.AddPoints vTimes, vValues, vAttrs, 0
End If
Example2:
Time has to be entered as the "standard time" even in the daylight-saving season:
Dim vTimes, vValues, vAttrs
oTView.TimeSetType = 2
Set oPoints = oTView.Trends("t1").Points
If Not oPoints Is Nothing Then
  oPoints.AddPoints vTimes, vValues, vAttrs, 0
End If
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice