Introduction

 

Section 5 - XYZ Graphs


 

The XYZ graph is a type of chart that has three scale dimensions. The columns assigned to the y2-axis become the height, to the x-axis is the depth, and to the y1-axis is the width.

 

To create this graph you need to assign a column to each of these axes. The ColumnType for the columns assigned to the y axes should be set to area type (2). The graph is displayed as a surface.

 

The surface is created by averaging each point to the junction of a grid in which the size is set with the XYZGridSize property. The larger the XYZGridSize property, the finer the surface appears. However, because there are many more points to average, it takes longer to generate the graph.

 

It's time to create a new project, with a new Flipper Graph Control and data.

FlpGrf.DataInit = 3

FlpGrf.DataValue(1, 0) = 4
FlpGrf.DataValue(2, 0) = 12
FlpGrf.DataValue(3, 0) = 15
FlpGrf.DataValue(4, 0) = 25
FlpGrf.DataValue(5, 0) = 34
FlpGrf.DataValue(6, 0) = 46
FlpGrf.DataValue(7, 0) = 52
FlpGrf.DataValue(8, 0) = 68
FlpGrf.DataValue(9, 0) = 72
FlpGrf.DataValue(10, 0) = 80
 
FlpGrf.DataValue(1, 1) = 23
FlpGrf.DataValue(2, 1) = 78
FlpGrf.DataValue(3, 1) = 23
FlpGrf.DataValue(4, 1) = 12
FlpGrf.DataValue(5, 1) = 45
FlpGrf.DataValue(6, 1) = 64
FlpGrf.DataValue(7, 1) = 12
FlpGrf.DataValue(8, 1) = 42
FlpGrf.DataValue(9, 1) = 39
FlpGrf.DataValue(10, 1) = 80
 
FlpGrf.DataValue(1, 2) = 0
FlpGrf.DataValue(2, 2) = 15
FlpGrf.DataValue(3, 2) = 23
FlpGrf.DataValue(4, 2) = 45
FlpGrf.DataValue(5, 2) = 23
FlpGrf.DataValue(6, 2) = 17
FlpGrf.DataValue(7, 2) = 8
FlpGrf.DataValue(8, 2) = 17
FlpGrf.DataValue(9, 2) = 24
FlpGrf.DataValue(10, 2) = 45

 

The GraphType needs to be set to 3 for the XYZ type. Also, the graph must be rotated, or it will remain a 2D graph.

FlpGrf.GraphType = 3 ' XYZ
FlpGrf.Graph3DRotation = 40

 

Assign column 0 to the x-axis, column 1 to the y-axis, and column 2 to the y2-axis. The types of the y axes need to be set to area (type 2) as well.

FlpGrf.Column = 0
FlpGrf.ColumnAxis = 0
 
FlpGrf.Column = 1
FlpGrf.ColumnAxis = 1
FlpGrf.ColumnType = 2
 
FlpGrf.Column = 2
FlpGrf.ColumnAxis = 2
FlpGrf.ColumnType = 2

 

images/bmptut371.png

The color of the top and bottom of the surface are the colors of the columns assigned to y1-axis and y2-axis, respectively.

 

The XYZ graph can also be display as a mesh graph. The mesh does not have a solid surface so you can see through it.

FlpGrf.XYZType = 2

 

images/tut38.png

 

Congratulations! You have just completed the fifth section of the tutorial, please follow this link to move on to the next section.

 

 

Last modified on: Friday, August 16, 2002