AddTrend - method of the PmgTrendViewer object
Description:
Creates a new object of the
tvTrend type.
The object is located at the end of the trends container and whenever it is accessible by the Trends method.
Syntax:
Object AddTrend(String sID, String sName)
Parameters:
sID | (String) Trend identifier (maximal length is 64 characters) |
---|
sName | (String) User name of trend |
---|
Return values:
Returns the created
tvTrend object.
If the creation of the object failed, then returns value null for JavaScript or Nothing pro VBScript.
Nothing value can be tested by VBScript
Is operator.
Note:
The maximal number of trends is 255.
If the parameters are not entered or they are set as empty strings (""), then new tvTrend object with default parameters sID and sName will be created.
New object with preset parameters can be created also on the "Trends" tab.
Example:
JavaScriptVBScriptSelect and copy to clipboard
var oTView = pMe;
var oTrend = oTView.AddTrend("t1", "Temperature");
if (oTrend)
//.. ok
else
//.. error
Dim oTView, oTrend
Set oTView = pMe
Set oTrend = oTView.AddTrend("t1", "Temperature")
If Not oTrend Is Nothing Then
'.. ok
Else
'.. error
End If