Page 1 of 1

Add a 3D Surface at run time

Posted: Mon Feb 13, 2012 2:07 pm
by 9342094
Hi there,

How can I add a 3D Surface at run time?
And fill with x, y and z values?

Thanks in advance,

Dennis

Re: Add a 3D Surface at run time

Posted: Tue Feb 14, 2012 8:51 am
by yeray
Hi,

All the series can be added at runtime. For example:

Code: Select all

uses TeeSurfa;

procedure TForm1.FormCreate(Sender: TObject);
var x, y, z: Integer;
begin
  Chart1.Aspect.Orthogonal:=false;
  Chart1.Chart3DPercent:=100;
  Chart1.Aspect.Zoom:=75;
  Chart1.Legend.Visible:=false;

  with Chart1.AddSeries(TSurfaceSeries) as TSurfaceSeries do
  begin
    for x:=0 to 20 do
      for z:=0 to 20 do
      begin
        y:=x*z;
        AddXYZ(x, y, z);
      end;
  end;
end;