Getting Z values from ColorGrid

TeeChart for ActiveX, COM and ASP
Post Reply
John
Newbie
Newbie
Posts: 3
Joined: Fri Nov 15, 2002 12:00 am

Getting Z values from ColorGrid

Post by John » Thu Apr 07, 2005 3:28 pm

I have a colorgrid control and now want to extract a horizontal and vertical cross section from the plotted data. How does one extract all the Z values from a whole row and all the Z values from a column.

On another note, why does the colorgrid controls axes seem to be the wrong orientation. When I look at the control I would expect X to be horizontal, Y to be vertical and Z to be the intensity. But in reality X is
horizonal, Z is vertical and Y is the intensity.

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

Post by Narcís » Fri Apr 08, 2005 9:54 am

Hi John,
I have a colorgrid control and now want to extract a horizontal and vertical cross section from the plotted data. How does one extract all the Z values from a whole row and all the Z values from a column.
Yes, this can be done using some code like:

Code: Select all

Private Sub Form_Load()
    TChart1.Series(0).FillSampleValues 10
    
    Label1.Caption = ""
    Label2.Caption = ""
End Sub

Private Sub TChart1_OnClickSeries(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
    
    Label1.Caption = "Row Z Values: "
    Label2.Caption = "Col. Z Values: "
    
    Dim xval, zval As Integer
    
    xval = TChart1.Series(SeriesIndex).XValues.Value(ValueIndex)
    zval = TChart1.Series(SeriesIndex).asColorGrid.ZValues.Value(ValueIndex)
    
    For i = 0 To TChart1.Series(SeriesIndex).Count - 1
    
        If TChart1.Series(SeriesIndex).XValues.Value(i) = xval Then
            Label2.Caption = Label2.Caption + " " _
                + CStr(TChart1.Series(SeriesIndex).asColorGrid.ZValues.Value(i))
        End If
        
        If TChart1.Series(SeriesIndex).asColorGrid.ZValues.Value(i) = zval Then
            Label1.Caption = Label1.Caption + " " _
                + CStr(TChart1.Series(SeriesIndex).asColorGrid.ZValues.Value(i))
        End If
        
    Next i
End Sub
On another note, why does the colorgrid controls axes seem to be the wrong orientation. When I look at the control I would expect X to be horizontal, Y to be vertical and Z to be the intensity. But in reality X is
horizonal, Z is vertical and Y is the intensity.
The TeeChart 3D series work on a grid that has a Y=Y(X,Z) format.
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