hi there,
Can i generate Polinomial & exponetial Trend line and Equation?
Polynomial & Exponential Trend
Hi Faruque
The Exponetial Trend function has a CalculateTrend method as Trend function, it works the same way:
For polynomial fitting you should use Steema.TeeChart.Functions.PolyFitting function class. It has a Coefficient(int index) method which returns polynomial coefficients. There is an example of this available in TChart.Net demo. Check the examples under the tab "All Features\Functions\Extended\Polynomial Fitting ", You'll find the demo at TeeChart's program group.
You should be aware of is polynomial coefficents are calculated for scaled x and y values i.e. Y -> Y - Ymin and X -> X - Xmin. This is to avoid fpu when large x or y values are used in series. Internally the algorithm uses Gaussian method to find optimized polynomial coefficients.
The Exponetial Trend function has a CalculateTrend method as Trend function, it works the same way:
Code: Select all
expTrendFunction1.CalculateTrend(expTrendFunction1.Series, 0, expTrendFunction1.Series.Count - 1, ref m, ref b);
label2.Text = "y = " + b.ToString() + "x + " + m.ToString();
You should be aware of is polynomial coefficents are calculated for scaled x and y values i.e. Y -> Y - Ymin and X -> X - Xmin. This is to avoid fpu when large x or y values are used in series. Internally the algorithm uses Gaussian method to find optimized polynomial coefficients.