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.
Getting Z values from ColorGrid
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi John,
Yes, this can be done using some code like: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.
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
The TeeChart 3D series work on a grid that has a Y=Y(X,Z) format.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.
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 |