Page 1 of 1

HOW TO CHANGE THE Z AXIS SCALE OF TSurfaceSeries!

Posted: Sun Dec 17, 2006 2:10 am
by 9348298
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!

Posted: Mon Dec 18, 2006 9:47 am
by narcis
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.