Page 1 of 1

How to assign a curve fitting function at runtime

Posted: Wed Dec 24, 2008 1:50 am
by 10050727
I am using Delphi and TChart 8.1.

I want to chart a curve fitting for a TFastLineSeries created at runtime.

I do not understand the example since it defines the curve fitting at design time.

Can you point me to an example that does this?

When I try to define:

fitting : TCurveFittingFunction; // This gives Undeclared identifier

Thanks
Kent

Posted: Wed Dec 24, 2008 8:22 am
by narcis
Hi Kent,

First of all please notice that there's v8.04 VCL available at the client area.

Your problem is most likely because you need to add CurvFitt at your unit's uses section:

Code: Select all

uses Series, CurvFitt;

procedure TForm1.FormCreate(Sender: TObject);
var SourceSeries, FunctionSeries: TLineSeries;
begin
  SourceSeries:=TLineSeries.Create(self);
  Chart1.AddSeries(SourceSeries);

  FunctionSeries:=TLineSeries.Create(self);
  Chart1.AddSeries(FunctionSeries);
  FunctionSeries.FunctionType:=TCurveFittingFunction.Create(self);
  FunctionSeries.DataSource:=SourceSeries;

  SourceSeries.FillSampleValues();
end;