color line with depth

TeeChart for ActiveX, COM and ASP
Post Reply
zizou5
Newbie
Newbie
Posts: 17
Joined: Mon Jun 11, 2007 12:00 am
Contact:

color line with depth

Post by zizou5 » Fri Oct 22, 2010 8:17 am

Hello, I need to display thick color vertical line in 3D surface graph at coordinates X = 0, Z(depth) = 5 (at the middle of the depth axis). Do you know how to achieve this? Any idea or way how to display it will be wellcomed. I'm using Teechart v7 activeX. Thanx for reply.

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

Re: color line with depth

Post by Narcís » Mon Oct 25, 2010 8:49 am

Hi zizou5,

You can custom draw this on TeeChart's canvas like this:

Code: Select all

Private Sub Form_Load()
    TeeCommander1.Chart = TChart1
    
    TChart1.AddSeries scSurface
    
    For X = 0 To 10
        For Z = 0 To 10
            TChart1.Series(0).asSurface.AddXYZ X, Rnd, Z, "", clTeeColor
        Next
    Next
    
    TChart1.Axis.Depth.Visible = True
End Sub

Private Sub TChart1_OnAfterDraw()
    X0 = TChart1.Axis.Bottom.CalcXPosValue(0)
    X1 = X0
    Y0 = TChart1.Axis.Left.IStartPos
    Y1 = TChart1.Axis.Left.IEndPos
    Z = TChart1.Axis.Depth.CalcXPosValue(5)
    
    With TChart1.Canvas
        .Pen.Width = 5
        .Pen.Color = vbBlack
        .LineWithZ X0, Y0, X1, Y1, Z
    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

zizou5
Newbie
Newbie
Posts: 17
Joined: Mon Jun 11, 2007 12:00 am
Contact:

Re: color line with depth

Post by zizou5 » Mon Oct 25, 2010 11:12 am

Cool, that is exactly what I've needed. Could I also draw text into 3D space with specific coordinates?

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

Re: color line with depth

Post by Narcís » Mon Oct 25, 2010 11:17 am

Hi zizou5,

Yes, use TextOut3D method.
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

zizou5
Newbie
Newbie
Posts: 17
Joined: Mon Jun 11, 2007 12:00 am
Contact:

Re: color line with depth

Post by zizou5 » Tue Oct 26, 2010 6:18 am

Thank you! That's been helpful much :)

Post Reply