HOW TO CHANGE THE Z AXIS SCALE OF TSurfaceSeries!

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
hexfhhu
Newbie
Newbie
Posts: 21
Joined: Thu Dec 07, 2006 12:00 am

HOW TO CHANGE THE Z AXIS SCALE OF TSurfaceSeries!

Post by hexfhhu » Sun Dec 17, 2006 2:10 am

When I draw Vector 3D with TSurfaceSeries(DEIPHI 7.0, TCHART7.07), the Z axis scale should be input with the SAME num, or the picture can’t be drawled.
For example:
When I input the follow code :
series1.addxyz(0,0.5,0);
series1.addxyz(10,0.5,0);
series1.addxyz(25,0.5,0);

series1.addxyz(0,0.6,1.1);
series1.addxyz(10,0.6,1.5);
series1.addxyz(25,0.6,1.3);

series1.addxyz(0,0.75,2);
series1.addxyz(10,0.75,2);
series1.addxyz(25,0.75,2);
the 3D cann’t be drawled. How to cure this problem? Thank you!

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Dec 18, 2006 9:47 am

Hi hexfhhu,

TSurfaceSeries needs to be populated having a grid structure where columns are determined by X values and rows are defined by Z values. Each cell value is defined by Y values. Considering this you should be able to populate a surface series using a for nested loop, for example:

Code: Select all

  for x:=0 to 10 do
    for  z:=0 to 5 do
      Series1.AddXYZ(x,random,z);
Also there are some variants to this allowed by IrregularGrid property:

Code: Select all

  Series1.IrregularGrid := true;
You need to set IrregularGrid property to true (by default set to false) in the following cases:

1. When X and Z intervals are not equidistant.
2. When X or Z intervals are different from 1.
3. When X or Z intervals have negative values.

Considering this your series may be populated like this:

Code: Select all

  series1.addxyz(0,0,0.5);
  series1.addxyz(10,0,0.5);
  series1.addxyz(25,0,0.5);

  series1.addxyz(0,1.1,0.6);
  series1.addxyz(10,1.5,0.6);
  series1.addxyz(25,1.3,0.6);

  series1.addxyz(0,2,0.75);
  series1.addxyz(10,2,0.75);
  series1.addxyz(25,2,0.75);

  Series1.IrregularGrid:=true;
Note that I inverted Y and Z values and set IrregularGrid to true.
Best Regards,
Narcís Calvet / 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