[]
        
(Showing Draft Content)

GrapeCity.Spreadsheet.Charts.ITrendlines.Add

Add Method

Add(TrendlineType, int, int, double, double, double, bool, bool, string)

Creates a new trendline.

Declaration
ITrendline Add(TrendlineType type, int order = 2, int period = 2, double forward = 0, double backward = 0, double intercept = NaN, bool displayEquation = false, bool displayRSquare = false, string name = null)
Function Add(type As TrendlineType, Optional order As Integer = 2, Optional period As Integer = 2, Optional forward As Double = 0, Optional backward As Double = 0, Optional intercept As Double = NaN, Optional displayEquation As Boolean = False, Optional displayRSquare As Boolean = False, Optional name As String = Nothing) As ITrendline
Parameters
Type Name Description
TrendlineType type

The trendline type.

int order

The trendline order when type is Polynomial. Must be an integer from 2 to 6, inclusive.

int period

The trendline period when type is MovingAverage. Must be an integer greater than 1 and less than the number of data points in the series you are adding a trendline to.

double forward

The number of periods (or units on a scatter chart) that the trendline extends forward.

double backward

The number of periods (or units on a scatter chart) that the trendline extends backward.

double intercept

The trendline intercept. If this argument is omitted, the intercept is automatically set by the regression.

bool displayEquation

true to display the equation of the trendline on the chart (in the same data label as the R-squared value).

bool displayRSquare

true to display the R-squared value of the trendline on the chart (in the same data label as the equation).

string name

The name of the trendline as text.

Returns
Type Description
ITrendline

An ITrendline object that represents the new trendline.