ChartAddTrendLine method (WinStudio scripts)

Applies To

IWSFormComponent interface

Definition

This method adds a trend line to a chart component, using line elements to define the trend line attributes.

Syntax

Dim trendLineName As TrendLine

trendLineName.attributeX = valueX

chart.ChartAddTrendLine( trendLineName )

  Part     Description    
trendLineName Required. Specifies the name by which the trend line is to be identified.  
attributeX Optional. Specifies the name of a trend line attribute.
valueX One required for each attribute specified. Specifies the value to be assigned to attirbuteX.

Remarks

You should declare and name the trend line and its attributes before you attempt to use this method to add the trend line to the chart. It is also a good practice to employ the ChartClearTrendLines method before you declare and use this one.

You can use this method to define multiple trend lines.

For a complete list and description of the trend line attributes available for scripting, see Specifying trend line settings for charts.

Example

This example shows how the trend line should first be defined/declared and the attributes specified before the trend line is actually added to the chart.

This example is given in Visual Basic.

Dim trendLine As TrendLine
trendLine.StartValue = 1.5
trendLine.Color = "00FF00"
trendLine.Dashed = True
trendLine.DisplayValue = "High"
chart.ChartAddTrendLine( trendLine )