Page 1 of 1

What can be the reason for smooth not working

Posted: Wed Feb 11, 2015 8:51 pm
by 16569278
If I understood right setting the smoothed property of a lineseries to true should smooth the line series.
What can be the reason if this does not happen in my case?

Re: What can be the reason for smooth not working

Posted: Thu Feb 12, 2015 11:14 am
by yeray
Hello,

It seems to work fine for me here in RAD XE7 and TeeChart Pro v2015.14.
I've dropped a TChart in a new "Multi-Device Application - Delphi" and using this code I see the series has 1000 points at the start, and 601 after pressing the button.

Code: Select all

uses FMXTee.Series;

var Series1: TLineSeries;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=False;
  Chart1.Legend.Visible:=False;

  Series1:=Chart1.AddSeries(TLineSeries) as TLineSeries;
  Series1.FillSampleValues(1000);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Series1.Smoothed:=True;
end;

procedure TForm1.Chart1AfterDraw(Sender: TObject);
begin
  Caption:='Number of points: ' + IntToStr(Series1.Count);
end;

Re: What can be the reason for smooth not working

Posted: Fri Feb 13, 2015 11:57 am
by 16569278
Hi Yeray,
in the setup you described this is also working for me.
In my "real"-application I have however the prroblem hat it is not working like that (I found a workarround though).
The workaround in my case is to do it as follows ...

sf := TSmoothingFunction.Create(self);
ChartSeriesSmoothed.FunctionType := TTeeFunction(sf);
ChartSeriesSmoothed.DataSource := ChartSeriesUnsmoothed;
ChartSeriesUnsmoothed.Active := false;
ChartSeriesSmoothed.Active := true;

But I do not know why I need to do it like this. Right before the code snippet above I fill the charseriesunsmoothed with data, using the AddXY method.

Re: What can be the reason for smooth not working

Posted: Fri Feb 13, 2015 2:40 pm
by yeray
Hi Roland,

I'm glad to hear you found a way to make it work as you wish!
On the other hand, we'll be glad to investigate why the smoothed property isn't working as expected. However, to further investigate this we'd need to get a simple example project we can use to reproduce the situation here.

Re: What can be the reason for smooth not working

Posted: Fri Feb 13, 2015 3:43 pm
by 16569278
What is the best way to provide you the sample project?- I could get one done.

Re: What can be the reason for smooth not working

Posted: Fri Feb 13, 2015 3:48 pm
by yeray
Hi,
Roland wrote:What is the best way to provide you the sample project?- I could get one done.
You can attach your files here in the forums.
If it contains information you don't want to make public, you can post your files at our upload page.