Page 1 of 1

smoothing function

Posted: Fri Oct 21, 2005 2:40 pm
by 9340187
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

Posted: Fri Oct 21, 2005 3:08 pm
by narcis
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;