No Fitted Line on Re-Plot

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Hans Wolfgang
Newbie
Newbie
Posts: 58
Joined: Fri Nov 15, 2002 12:00 am
Location: Naples, FL
Contact:

No Fitted Line on Re-Plot

Post by Hans Wolfgang » Sat Jan 14, 2006 6:24 pm

My form has a tChart, a tPointSeries and a tCurveFittingFunction, which draws a best-fit through the plotted tPointSeries points. An execute button launches this process, pulls data from a user input control, adds titles, and plots all points including the fitted line when the tChart visible property is set to true.

Now, suppose the user wants to modify plotted points and presses the execute button a second time. The new points are plotted, but the fitted line does not reappear. The user is compelled to stop and restart the application in order to get the fitted line. I tried adding a call to tCurveFittingFunction.Calculate(), but that did not help. What is needed in order to have the fit line included on every press of the execute button?

Any ideas appreciated.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Jan 16, 2006 8:53 am

Hi Hans,

You could try using CheckDataSource method for the series which have the function assigne, i.e.:

Code: Select all

tmpLineSeries.CheckDataSource;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Hans Wolfgang
Newbie
Newbie
Posts: 58
Joined: Fri Nov 15, 2002 12:00 am
Location: Naples, FL
Contact:

Post by Hans Wolfgang » Wed Jan 18, 2006 4:20 pm

Narcis,

I tried your suggestion. Regret to advise it does not help. Re-plotting the points still does not produce the fitted line.

Any other ideas would be helpful.

Hans Wolfgang
Newbie
Newbie
Posts: 58
Joined: Fri Nov 15, 2002 12:00 am
Location: Naples, FL
Contact:

Post by Hans Wolfgang » Wed Jan 18, 2006 4:41 pm

By adding BeginUpdate I get the line to appear. However, the curve fit is not recalculated. The fitted line is simply redrawn as first plotted. I proved this by adding an outlier to the dataset. The outlier should cause a shift in the fitted line. How can I get the curve fitter to recalculate all of its points?

(I also tried setting Active true, DrawBetweenPoints true, without success.)

Hans Wolfgang
Newbie
Newbie
Posts: 58
Joined: Fri Nov 15, 2002 12:00 am
Location: Naples, FL
Contact:

Post by Hans Wolfgang » Wed Jan 18, 2006 4:58 pm

Found the answer. The Trick is to call tCurveFittingFunction.AddPoints(). Strangely, that call is not needed for the first plot; it appears that the call is needed only if the data are corrected and user wants to plot a new fit. But I leave it active in either case.

Post Reply