ChangeFitType

The ChangeFitType method changes the fit type for the parent autofitplot object.

Syntax

object.ChangeFitType( fitType, Option )

Parameter Type Description
fitType Long required, grfFitTypes
Option Double

required, Fit option. See Option property.

Remarks

The meaning of the Option parameter varies according to the fit type. For example, if fit type is “running average” or “weighted average”, the option stores the window width value. If fit type is “Loess”, the option stores the span value. If the fit type is “polynomial”, the option stores the polynomial degree. If fit type is “spline smoothing”, the option stores the tension factor.

Example 1

The following example changes the fit type to linear. The Option parameter is set arbitrarily to 0, since it has no effect for a linear fit.

autofitplot.ChangeFitType(fitType:=grfLinearFit, 0)

Example 2

The following example changes the fit type to weighted average with a window width of 31.

autofitplot.ChangeFitType(fitType:=grfWeightedAvgFit, 31)

 

Used by: AutoFitPlot object