Tri surface series get x,y,z value

TeeChart for ActiveX, COM and ASP
Post Reply
amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Tri surface series get x,y,z value

Post by amol » Thu Jul 30, 2015 10:34 am

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 .
Attachments
3dplotting.jpg
3dplotting.jpg (132.38 KiB) Viewed 17931 times

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

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

Post by Narcís » Thu Jul 30, 2015 10:46 am

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
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

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

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

Post by amol » Fri Jul 31, 2015 11:21 am

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

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

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

Post by Narcís » Fri Jul 31, 2015 11:36 am

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.
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

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

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

Post by amol » Thu Aug 06, 2015 12:46 pm

845b2aeeb0cfcbe0-0.jpg
845b2aeeb0cfcbe0-0.jpg (371.25 KiB) Viewed 17842 times
Attachments
845b2aeeb0cfcbe0-1.jpg
845b2aeeb0cfcbe0-1.jpg (415.69 KiB) Viewed 17813 times

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

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

Post by Narcís » Thu Aug 06, 2015 1:01 pm

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.
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

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

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

Post by Narcís » Thu Aug 06, 2015 1:25 pm

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
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