changing a few properties of 3d surface plots

TeeChart for ActiveX, COM and ASP
Post Reply
Mark#1
Newbie
Newbie
Posts: 10
Joined: Mon Aug 30, 2004 4:00 am

changing a few properties of 3d surface plots

Post by Mark#1 » Thu May 11, 2006 3:10 pm

Greetings:

I am using v7.0.0.2 to generate some very nice 3d surface plots. However, I am trying to implement code that allows for more flexible modification of the graphs. There are two things that I want to achieve:

1) I need to remove axis tick labels. Right now, I use the following code:
TChart1.Axis.Bottom.Labels.Visible = False
TChart1.Axis.Depth.Labels.Visible = False

This successfully removes the tick labels, but also has the undesired effect of also removing the ticks themselves. Is there a way to fix this?

2) With respect to the ticks themselves, on 3d surface plots, the ticks are extended in a way to make background "walls" that indirectly reflect surface plot heights. I would ideally like to be able to write code so that these "tick walls" (sorry...I don't have a better term to use to describe this!) can be moved from the background to the foreground. Is there any way to implement this?

Thanks in advance!

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon May 15, 2006 9:39 am

Hi,

1) One way to accomplish this is by using the OnGetAxisLabel event to remove the axis labels like in the following code :

Code: Select all

Private Sub TChart1_OnGetAxisLabel(ByVal Axis As Long, ByVal SeriesIndex As Long, ByVal ValueIndex As Long, LabelText As String)
If Axis = atLeft Then
                LabelText = " "
End If
End Sub
2) What about using :
TChart1.Axis.DrawAxesBeforeSeries = false
?

Mark#1
Newbie
Newbie
Posts: 10
Joined: Mon Aug 30, 2004 4:00 am

Post by Mark#1 » Mon May 15, 2006 3:05 pm

Thanks for the reply:

Regarding query #1. Is there an easy way to make this a dynamic process? I am uncertain as to how I could pass information to this function to accomplish my goal. Ultimately, I would like to have a user be able to select a menu item such as "Disable tick marks", and then have the ticks dynamically removed.

Hope I'm making sense!

Regarding the second question, the code provided only seems to swap the tick wall for one axis. Is there a way to change the position of the tick wall on both axes?

Thanks, and again, please let me knoe if I'm not making sense!

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed May 17, 2006 8:54 am

Hi Mark,

1) there's not other way that I know , but you should be able to accomplish the option you want using similar code to the one below (using the Repaint method to call the OnGetAxisLabel again) :

Code: Select all

Private Sub Check1_Click()
TChart1.Repaint
End Sub

Private Sub Command1_Click()
TChart1.Axis.DrawAxesBeforeSeries = False
TChart1.Axis.Right.ZPosition = 0
End Sub

Private Sub TChart1_OnGetAxisLabel(ByVal Axis As Long, ByVal SeriesIndex As Long, ByVal ValueIndex As Long, LabelText As String)
If Check1.Value Then
If Axis = atLeft Then
                LabelText = " "
End If
Else
LabelText = LabelText
End If
End Sub
2) To move the othe axis like the Right axis you will have to use the ZPosition property.

Post Reply