smoothing function

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Jennifer
Newbie
Newbie
Posts: 20
Joined: Tue Dec 07, 2004 5:00 am

smoothing function

Post by Jennifer » Fri Oct 21, 2005 2:40 pm

we are trying to smooth a series[profile series] and the series does not show up. Heres our code

Procedure Tform1.DrawProfile4;
VAR
profilenode:TstListNode;
min,max,mm:Integer;
Tfunctiona:Tsmoothingfunction;
BEGIN
profileseries.clear;
smoothseries.clear;
profchart.bottomaxis.setminmax(profminfld.asInteger,profmaxfld.asInteger);
Tfunctiona:=Tsmoothingfunction.create(self);
Tfunctiona.interpolate:=false;
Tfunctiona.factor:=10;
smoothseries.setfunction(Tfunctiona);
smoothseries.DataSources.add(profileseries);
smoothseries.checkdatasource;
FOR mm:=profminfld.asInteger TO profmaxfld.asInteger Do Begin
profilenode:=mylist.items[mm];
profileseries.addXY(mm,tnodetype(profilenode.data^).mono,'',clTeeColor);
end;
END;
Thanls,
Jennifer

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

Post by Narcís » Fri Oct 21, 2005 3:08 pm

Hi Jennifer,

You should use CheckDataSource method after populating source series:

Code: Select all

FOR mm:=profminfld.asInteger TO profmaxfld.asInteger Do Begin 
profilenode:=mylist.items[mm]; 
profileseries.addXY(mm,tnodetype(profilenode.data^).mono,'',clTeeColor); 
smoothseries.checkdatasource;
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