How can I remove points from TChartSeries

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
susi
Newbie
Newbie
Posts: 10
Joined: Wed Jul 28, 2004 4:00 am

How can I remove points from TChartSeries

Post by susi » Thu May 20, 2010 12:21 pm

Hi,

I have added so many points to a series by calling AddXY that EOutOfMemory is raised whenever I'm calling AddXY again. Now, I want to remove every second point of the chart (i.e. reduce the number of samples) to free some memory. How can I do that?

Regards,

S.

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

Re: How can I remove points from TChartSeries

Post by Yeray » Thu May 20, 2010 1:39 pm

Hi susi,

Is the following what you are trying to do?

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var i: Integer;
begin
  i:=1;
  while (i < Series1.Count-1) do
  begin
    Series1.Delete(i);
    i:=i+1;
  end;
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

susi
Newbie
Newbie
Posts: 10
Joined: Wed Jul 28, 2004 4:00 am

Re: How can I remove points from TChartSeries

Post by susi » Fri May 21, 2010 11:39 am

Yes, but the software hangs when I do that with a chart that is so big that it raised the EOutOfMemory exception.

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

Re: How can I remove points from TChartSeries

Post by Yeray » Fri May 21, 2010 1:44 pm

Hi susi,

If the problem is with the drawing of the big amount of points, you could try with the DownSampling function (see the demo at All features\Welcome !\Functions\Extended\Reducing number of points)
If the problem is with the memory, as it seems to be, there isn't too much TeeChart can do for you. It depends on the machine capacity and the number of values you are loading into memory. Here the better option would be to add some control of the points before being added.

If you still have problems with it, please send us a simple example project we can run as-is to reproduce the problem 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

Post Reply