Hide label text but show grid lines

TeeChart for ActiveX, COM and ASP
Post Reply
raymond
Newbie
Newbie
Posts: 1
Joined: Sat Jan 06, 2001 5:00 am

Hide label text but show grid lines

Post by raymond » Fri Mar 25, 2005 10:57 pm

Using ActiveX TeeChart 5.

Seems like grid lines on aplot are interlocked with axis label text so that it is impossible to hide the labels and still see the grid lines. There are examples on the web indicating that setting
.axis.left.Labels.Style = talNone
should just hide the labels, but it also hides major and minor grid lines, just like
.axis.left.labels.visible = False
does.

Setting the label to "" in OnGetAxisLabel hides the labels, but keeps all spacing that the labels would have used. Same effect as setting the label text font color to match the panel background.

Can anyone help? I'm trying to implement an ecg plot that needs a standard looking grid, but labels are pretty meaningless.

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

Post by Pep » Tue Mar 29, 2005 2:04 pm

Hi Raymond,

one way could be setting font size to 1 :

Code: Select all

Private Sub Command1_Click()
With TChart1.Axis.Bottom
    .Labels.Font.Size = 1
    .TickLength = 0
    .TickInnerLength = 0
End With
End Sub

Private Sub TChart1_OnGetAxisLabel(ByVal Axis As Long, ByVal SeriesIndex As Long, ByVal ValueIndex As Long, LabelText As String)
If Axis = 3 Then
    LabelText = " "
End If
End Sub

Post Reply