Best Fit Curve through data points

TeeChart for ActiveX, COM and ASP
Post Reply
Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Dec 09, 2003 5:00 pm

Here is one example of "Curve Fitting" function :

Code: Select all

Private Sub Form_Load()
Dim i As Integer
   With TChart1
            .Aspect.View3D = False
            .AddSeries scPoint
            For i = 0 To 4
                .Series(0).AddXY i, Rnd() * 100, "", clTeeColor
            Next i
            .AddSeries scLine
            .Series(1).SetFunction tfCurveFit
            .Series(1).DataSource = "Series0"
            .Series(1).FunctionType.PeriodStyle = psNumPoints
            .Series(1).FunctionType.PeriodAlign = paFirst
            .Series(1).FunctionType.asCurveFit.FirstCalcPoint = 0
            .Series(1).FunctionType.asCurveFit.FirstPoint = 0
            .Series(1).FunctionType.asCurveFit.PolyDegree = 5
            .Series(1).FunctionType.Period = 1
            .Series(1).CheckDataSource
    End With
End Sub
Josep Lluis Jorge
http://support.steema.com

Post Reply