I am trying to make a color grid. I have a matrix of data with regular intervals. That is, the matrix looks like:
x11 x12 ... x1N
x21 x22 ... x2N
.. .. ..
xM1 xM2 ... xMN
I am basically trying to get a colored picture of the matrix, that is a grid that is NxM where each grid cell is colored according to the corresponging xij value.
The surface and color grid options in TeeChart create a surface with M-1 X N-1 grid cells. Each point, xij, therefore is a corner of on of the grid cells.
Is there any way to create the type of grid that I want?
Steve Bourne
color grid or surface that has N grid cells (not N-1)
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Steve,
There's only one way to fill ColorGrid series with data. As it has X,Y and Z values, the only "random" value is Y, X and Z have to be regular. You can see examples of this at the TeeChart features demo included with the installation. If you have search for the "ColorGrid Marks" example and click on "Edit Marks" and then click on the "Data" tab you will see how data works for this series type.
The TeeChart 3D series work on a grid that has a Y=Y(X,Z) format, meaning that data can be added in the following fashion:
There's only one way to fill ColorGrid series with data. As it has X,Y and Z values, the only "random" value is Y, X and Z have to be regular. You can see examples of this at the TeeChart features demo included with the installation. If you have search for the "ColorGrid Marks" example and click on "Edit Marks" and then click on the "Data" tab you will see how data works for this series type.
The TeeChart 3D series work on a grid that has a Y=Y(X,Z) format, meaning that data can be added in the following fashion:
Code: Select all
Private Sub Form_Load()
Dim x, y, z
TeeCommander1.Chart = TChart1
With TChart1
.AddSeries scSurface
y = 0
For x = 0 To 15
For z = 0 To 255
If z Mod 35 = 0 Then
y = y + 1
End If
.Series(0).asSurface.AddXYZ x, y, z, "", clTeeColor
Next z
Next x
End With
End Sub
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |