What can be the reason for smooth not working

TeeChart FireMonkey (Windows,OSX,iOS & Android) for Embarcadero RAD Studio, Delphi and C++ Builder (XE5+)
Post Reply
Roland
Newbie
Newbie
Posts: 20
Joined: Mon May 19, 2014 12:00 am

What can be the reason for smooth not working

Post by Roland » Wed Feb 11, 2015 8:51 pm

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?

Yeray
Site Admin
Site Admin
Posts: 9532
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: What can be the reason for smooth not working

Post by Yeray » Thu Feb 12, 2015 11:14 am

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;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Roland
Newbie
Newbie
Posts: 20
Joined: Mon May 19, 2014 12:00 am

Re: What can be the reason for smooth not working

Post by Roland » Fri Feb 13, 2015 11:57 am

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.

Yeray
Site Admin
Site Admin
Posts: 9532
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: What can be the reason for smooth not working

Post by Yeray » Fri Feb 13, 2015 2:40 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Roland
Newbie
Newbie
Posts: 20
Joined: Mon May 19, 2014 12:00 am

Re: What can be the reason for smooth not working

Post by Roland » Fri Feb 13, 2015 3:43 pm

What is the best way to provide you the sample project?- I could get one done.

Yeray
Site Admin
Site Admin
Posts: 9532
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: What can be the reason for smooth not working

Post by Yeray » Fri Feb 13, 2015 3:48 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply