Page 1 of 1

changing a few properties of 3d surface plots

Posted: Thu May 11, 2006 3:10 pm
by 9523778
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!

Posted: Mon May 15, 2006 9:39 am
by Pep
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
?

Posted: Mon May 15, 2006 3:05 pm
by 9523778
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!

Posted: Wed May 17, 2006 8:54 am
by Pep
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.