Page 1 of 1

Curvefitting (howto)

Posted: Fri Sep 15, 2006 12:17 pm
by 9238695
Hi

I have a set of data that is plotted in the graph SOURCE as a Line graph. In the same chart I can easily choose to make a curve fitted plot as well. But how can I calculate/get an Y-value from an arbitrary X-value. I could not find any examples that worked in C++. Maybe more explanation on the curve fitting function and how it works would also be appreciated.

Best regards
Carsten Hinrichsen

Posted: Fri Sep 15, 2006 2:03 pm
by narcis
Hi Carsten,

To obtain values from any point in a series you can do something as in the interpolating example I posted in this other thread.

CurveFitting function help info:

TCurveFittingFunction constructs a polynomial line based on its DataSource Series values.

The algorithm used to fit the points is a Gaussian Polynomial.

Use the PolyDegree property to determine the number of polynomial coefficients.

To see a visual representation of TeeChart Extended Functions, go to the TeeChart User Guide.

Posted: Mon Sep 18, 2006 12:50 pm
by 9238695
Hi

I could not find any help that gives an answer to my question. Do you have a pice of C++ code?

Regards
Carsten

Posted: Mon Sep 18, 2006 1:46 pm
by narcis
Hi Carsten,

Have you tried porting the interpolating example to C++? If so, which are the problems you found?