TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
-
Uwe Raabe
- Newbie
- Posts: 1
- Joined: Mon Feb 13, 2017 12:00 am
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
- Posts: 3132
- Joined: Fri Nov 07, 2008 12:00 am
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