EOutOfMemory with TSurfaceSeries

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Uwe Raabe
Newbie
Newbie
Posts: 1
Joined: Mon Feb 13, 2017 12:00 am

EOutOfMemory with TSurfaceSeries

Post by Uwe Raabe » Sun May 21, 2017 10:13 am

I get an EOutOfMemory exception displaying a 3D surface with my data. Luckily I was able to track down the problem to a few lines of code:
  • create a VCL forms application
  • drop a TChart onto the form
  • add a 3D surface series
  • execute the code below

Code: Select all

var
  I: Integer;
  J: Integer;
begin
  Series1.Clear;
  for I := 10 to 100 do begin
    for J := 1 to 100 do begin
      Series1.AddXYZ(I*10, Random(10), J*100000);
    end;
  end;
end;
The problem seems to be related to the large X- and Z-values. Everything is OK when the factor is removed.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: EOutOfMemory with TSurfaceSeries

Post by Sandra » Mon May 22, 2017 2:21 pm

Hello Uwe,

The problem is caused because the data values you add in your series are irregular. Therefore you need setting the surface's to IrregularGrid=true as do in code below:

Code: Select all

procedure TForm3.FormCreate(Sender: TObject);
var
  I: Integer;
  J: Integer;
begin
  Series1.Clear;
  Series1.IrregularGrid := true;
  for I := 10 to 100 do begin
    for J := 1 to 100 do begin
      Series1.AddXYZ(I*10, Random(10), J*100000);
    end;
  end;
end;

end.
Notice that such series need to be populated as described here.

Hoping this helps you.

Thanks in advance
Best Regards,
Sandra Pazos / 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