I need to apply a function to a Points Series.
I have tried
PolyFitting1.PolyDegree = 2
Points1.Function = PolyFitting1
PolyFitting1.Calculate(Points1, 0, Numberofsamples)
This does not appear to be correct.
Applying Functions to Teechart
Re: Applying Functions to Teechart
Hello lilo,
I recommend you that take a look in the demo example All features\Welcome !\Functions\Extended\Polynomial fitting\Finding coefficients, where there is an example of you need to apply a Polynomial fitting function and I think, you can do something as do in the example. If you have any problems, please let me know.
I hope will helps.
Thanks,
I recommend you that take a look in the demo example All features\Welcome !\Functions\Extended\Polynomial fitting\Finding coefficients, where there is an example of you need to apply a Polynomial fitting function and I think, you can do something as do in the example. If you have any problems, please let me know.
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Applying Functions to Teechart
Thanks Sandra,
I am using the example code but the coefficients keep returning 0.
PolyFitting1.PolyDegree = 2
Points1.DataSource = Points1
PolyFitting1.Chart = TChart1.Chart
Points1.Function = PolyFitting1
Points1.Function.Period = 2
Points1.CheckDataSource()
Points1.Function.Calculate(TChart1.Series(0), 0, NumofPoints - 1)
Dim t As Short
Dim txt = "y="
For t = 0 To PolyFitting1.PolyDegree - 1
txt += " "
If PolyFitting1.Coefficient(t) >= 0.0 Then txt += "+"
txt += PolyFitting1.Coefficient(t).ToString("0.00##")
If (t > 0) Then txt += "*x"
If (t > 1) Then txt += "^" + t.ToString()
Next
I am missing something in the code, but cannot figure out what it is?
I am using the example code but the coefficients keep returning 0.
PolyFitting1.PolyDegree = 2
Points1.DataSource = Points1
PolyFitting1.Chart = TChart1.Chart
Points1.Function = PolyFitting1
Points1.Function.Period = 2
Points1.CheckDataSource()
Points1.Function.Calculate(TChart1.Series(0), 0, NumofPoints - 1)
Dim t As Short
Dim txt = "y="
For t = 0 To PolyFitting1.PolyDegree - 1
txt += " "
If PolyFitting1.Coefficient(t) >= 0.0 Then txt += "+"
txt += PolyFitting1.Coefficient(t).ToString("0.00##")
If (t > 0) Then txt += "*x"
If (t > 1) Then txt += "^" + t.ToString()
Next
I am missing something in the code, but cannot figure out what it is?
Re: Applying Functions to Teechart
Hello lilo,
Can you try to arrange a simple project so we can reproduce your example exactly here and try to find where there is the problem?
Thanks,
Can you try to arrange a simple project so we can reproduce your example exactly here and try to find where there is the problem?
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Applying Functions to Teechart
Just a thought - I could add PolyFitting1.AddPoints method to the code.
What is the correct format for array Addpoints - there is no detailed reference in the documentation
Should I add an array of X Values or X and Y Values?
How should the Array be Declared?
Thanks,
What is the correct format for array Addpoints - there is no detailed reference in the documentation
Should I add an array of X Values or X and Y Values?
How should the Array be Declared?
Thanks,
Re: Applying Functions to Teechart
Got the original code working. Just had to activate and relate the charts in the editor.
Thanks,
Thanks,
Re: Applying Functions to Teechart
Hi lilo,
I am glad that you have found the solution for your problem .
Thanks,
I am glad that you have found the solution for your problem .
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |