Page 1 of 1
color line with depth
Posted: Fri Oct 22, 2010 8:17 am
by 9535497
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.
Re: color line with depth
Posted: Mon Oct 25, 2010 8:49 am
by narcis
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
Re: color line with depth
Posted: Mon Oct 25, 2010 11:12 am
by 9535497
Cool, that is exactly what I've needed. Could I also draw text into 3D space with specific coordinates?
Re: color line with depth
Posted: Mon Oct 25, 2010 11:17 am
by narcis
Hi zizou5,
Yes, use TextOut3D method.
Re: color line with depth
Posted: Tue Oct 26, 2010 6:18 am
by 9535497
Thank you! That's been helpful much