Page 1 of 1

No Fitted Line on Re-Plot

Posted: Sat Jan 14, 2006 6:24 pm
by 5890703
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.

Posted: Mon Jan 16, 2006 8:53 am
by narcis
Hi Hans,

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

Code: Select all

tmpLineSeries.CheckDataSource;

Posted: Wed Jan 18, 2006 4:20 pm
by 5890703
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.

Posted: Wed Jan 18, 2006 4:41 pm
by 5890703
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.)

Posted: Wed Jan 18, 2006 4:58 pm
by 5890703
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.