Making custom axis visible
Posted: Wed Nov 08, 2006 4:43 pm
We have upgraded form TeeChart v5 to v7 and code that used to make a custom axis and its grid visible now doesn't work anymore. It is meant to be a vertical axis (I'm not sure why the left axis isn't used instead!) The real code is a bit complicated but I've got two routines: one to set the left axis and one to set the custom axis. The one that sets the left works but the one for the custom one doesn't. What am I missing here??
Thanks.
Code: Select all
Private Sub Check1_Click(Index As Integer)
Debug.Print "Index is " & Index
If Check1(Index).Value = vbChecked Then
If gbDarkBackground Then
frmPI.TChart(Index).Axis.Custom(0).GridPen.Color = DARK_GRID_COLOUR
Else
frmPI.TChart(Index).Axis.Custom(0).GridPen.Color = LIGHT_GRID_COLOUR
End If
frmPI.TChart(Index).Axis.Custom(0).SetMinMax 0, 4
frmPI.TChart(Index).Axis.Custom(0).Increment = 1
frmPI.TChart(Index).Axis.Custom(0).GridPen.Visible = True
frmPI.TChart(Index).Axis.Custom(0).Visible = True
frmPI.TChart(Index).Axis.Custom(0).AxisPen.Visible = True
frmPI.TChart(Index).Axis.Custom(0).Labels.Visible = False
Else
frmPI.TChart(Index).Axis.Custom(0).GridPen.Visible = False
frmPI.TChart(Index).Axis.Custom(0).Visible = True
frmPI.TChart(Index).Axis.Custom(0).AxisPen.Visible = True
frmPI.TChart(Index).Axis.Custom(0).Ticks.Visible = False
frmPI.TChart(Index).Axis.Custom(0).Labels.Visible = False
End If
End Sub
Private Sub Check1_Click_old(Index As Integer)
Debug.Print "Index is " & Index
If Check1(Index).Value = vbChecked Then
If gbDarkBackground Then
frmPI.TChart(Index).Axis.Left.GridPen.Color = DARK_GRID_COLOUR
Else
frmPI.TChart(Index).Axis.Left.GridPen.Color = LIGHT_GRID_COLOUR
End If
frmPI.TChart(Index).Axis.Left.SetMinMax 0, 4
frmPI.TChart(Index).Axis.Left.Increment = 1
frmPI.TChart(Index).Axis.Left.GridPen.Visible = True
frmPI.TChart(Index).Axis.Left.Visible = True
frmPI.TChart(Index).Axis.Left.AxisPen.Visible = True
frmPI.TChart(Index).Axis.Left.Labels.Visible = False
Else
frmPI.TChart(Index).Axis.Left.GridPen.Visible = False
frmPI.TChart(Index).Axis.Left.Visible = True
frmPI.TChart(Index).Axis.Left.AxisPen.Visible = True
frmPI.TChart(Index).Axis.Left.Ticks.Visible = False
frmPI.TChart(Index).Axis.Left.Labels.Visible = False
End If
End Sub