Page 1 of 1

Tri surface series get x,y,z value

Posted: Thu Jul 30, 2015 10:34 am
by 9526439
The surface series, he should get the X, Y & Z position of the clicked region. Please let us know if there is a way we can get these values from Tee Chart while clicking on it. Please see the attached file for detail .

Re: Tri surface series get x,y,z value

Posted: Thu Jul 30, 2015 10:46 am
by narcis
Hello,

You can do this:

Code: Select all

Private Sub Form_Load()
    TChart1.AddSeries scTriSurface
    TChart1.Series(0).FillSampleValues
End Sub

Private Sub TChart1_OnMouseDown(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
    Index = TChart1.Series(0).Clicked(X, Y)
    
    If Index <> -1 Then
        Me.Caption = "X: " & CStr(TChart1.Series(0).XValues.Value(Index)) & _
                    ", Y: " & CStr(TChart1.Series(0).YValues.Value(Index)) & _
                    ", Z: " & CStr(TChart1.Series(0).asTriSurface.ZValues.Value(Index))
    End If
End Sub

Re: Tri surface series get x,y,z value

Posted: Fri Jul 31, 2015 11:21 am
by 9526439
Hi Narcis,

Thanks a lot for your comments. I did tried the solution as per your suggestion but the index retrieved is incorrect for tri-surface series. My application has 399 points only, but the index retrieved is 750. Do I need to perform any extra calculations for tri-surface series to get the correct index?

I tried your solution on other series too like point series, bubble series, etc and the index retrieved in these series is accurate. Problem lies with the tri-surface series only. Please guide if I am missing anything.

Regards,
Preetam

Re: Tri surface series get x,y,z value

Posted: Fri Jul 31, 2015 11:36 am
by narcis
Hi Preetam,

Yes, this looks like a bug to me. I have added it (Bug #1262) to the defect list to be fixed for future releases.

Re: Tri surface series get x,y,z value

Posted: Thu Aug 06, 2015 12:46 pm
by 9526439
845b2aeeb0cfcbe0-0.jpg
845b2aeeb0cfcbe0-0.jpg (371.25 KiB) Viewed 19573 times

Re: Tri surface series get x,y,z value

Posted: Thu Aug 06, 2015 1:01 pm
by narcis
Hello Preetam,

Could you please post your technical inquiries in a comprehensive format for this forums board? That is posting text and code as such an not as images. You can accompany it images and screen-shots, which are supported by this forums board and can be inserted into posts. That will make information here much easier to understand and work with for everybody that reads it. If you edit your text in a word processor, you just need to copy and past the text here. Formatting code with proper tags is also appreciated.

Thanks in advance.

Re: Tri surface series get x,y,z value

Posted: Thu Aug 06, 2015 1:25 pm
by narcis
Hi Preetam,

Regarding your technical inquiries:

1. What Remove custom colors button does is resetting all points to be clTeeColor, default color. Either populate your series using this color constant or don't use any color at all. A complete example that sets colors as you wish is this:

Code: Select all

Private Sub Form_Load()
    TChart1.AddSeries scTriSurface
    
    TChart1.Series(0).FillSampleValues 100
    TChart1.Series(0).Transparency = 50
    
    TChart1.Series(0).asTriSurface.UseColorRange = True
    TChart1.Series(0).asTriSurface.UsePalette = False
    TChart1.Series(0).asTriSurface.StartColor = RGB(255, 0, 0)
    TChart1.Series(0).asTriSurface.MidColor = RGB(0, 0, 255)
    TChart1.Series(0).asTriSurface.EndColor = RGB(255, 173, 91)
End Sub
2. Set series' Transparency property as shown in the code example above.

Code: Select all

    TChart1.Series(0).Transparency = 50