How to assign a curve fitting function at runtime

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
BlueMonkey
Newbie
Newbie
Posts: 34
Joined: Tue Nov 04, 2008 12:00 am

How to assign a curve fitting function at runtime

Post by BlueMonkey » Wed Dec 24, 2008 1:50 am

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

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

Post by Narcís » Wed Dec 24, 2008 8:22 am

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;
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

Post Reply