ICurveFittingFunction.LastPoint
ICurveFittingFunction

property LastPoint: Integer;

Type Library
TeeChartx

Description
Default Value: -1

Sets the last point index used to display the fitting

With FirstCalcPoint and LastCalcPoint properties you can restrict the subset of points CurveFittingFunction will use to calculate the polynomy coefficients and it's point values.

Example [Visual Basic]:

In this example LastPoint is being used with FirstValueIndex / LastValueIndex to refit a fitted curve (CurveFitSeries1) to a 'zoomed' series (LineSeries1).

Private Sub TChart1_OnZoom()

With TChart1

If .Series(0).FirstValueIndex > 0 Then

.Series(1).FunctionType.asCurveFit.FirstCalcPoint = _

.Series(0).FirstValueIndex - 1

.Series(1).FunctionType.asCurveFit.LastCalcPoint = _

.Series(0).LastValueIndex

Else

.Series(1).FunctionType.asCurveFit.FirstCalcPoint = _

.Series(0).FirstValueIndex

.Series(1).FunctionType.asCurveFit.LastCalcPoint = _

.Series(0).LastValueIndex

End If

If .Series(0).LastValueIndex - .Series(0).FirstValueIndex > 6 Then

.Series(1).FunctionType.asCurveFit.FirstPoint = _

.Series(0).FirstValueIndex + 1

.Series(1).FunctionType.asCurveFit.LastPoint = _

.Series(0).LastValueIndex - 1

End If

.Series(0).CheckDataSource

End With

End Sub