ICurveFittingFunction.LastCalcPoint
ICurveFittingFunction

property LastCalcPoint: Integer;

Type Library
TeeChartx

Description
Default Value: -1

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. Use FirstPoint and LastPoint to restrict the display range.

By default is -1, meaning all datasource points up to the last one will be used to perform the calculation.

The CheckDataSource method must be called after setting FirstPoint and LastPoint properties, forcing CurveFittingFunction to recalculate again all point values.

Example [Visual Basic]:

In this example LastCalcPoint 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