Page 1 of 1

Hide label text but show grid lines

Posted: Fri Mar 25, 2005 10:57 pm
by 6919534
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.

Posted: Tue Mar 29, 2005 2:04 pm
by Pep
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