color grid or surface that has N grid cells (not N-1)

TeeChart for ActiveX, COM and ASP
Post Reply
GWRI
Newbie
Newbie
Posts: 7
Joined: Wed Apr 02, 2003 5:00 am
Location: USA
Contact:

color grid or surface that has N grid cells (not N-1)

Post by GWRI » Mon Feb 14, 2005 7:08 pm

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

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

Post by Narcís » Tue Feb 15, 2005 8:54 am

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:

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
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply