The following example sets the major and minor grid line color for a two-dimensional bar chart using the ValueScale object.
Private Sub Command1_Click()
' Set chart type to 2d bar.
MSChart1.ChartType = VtChChartType2dBar
' Use manual scale to display y axis (value axis).
With MSChart1.Plot.Axis(VtChAxisIdY).ValueScale
.Auto = False
.MajorDivision = 2
.MinorDivision = 5
End With
' Show major grid line in red and minor grid line
' in blue.
With MSChart1.Plot.Axis(VtChAxisIdY).AxisGrid
.MajorPen.VtColor.Set 255, 0, 0
.MajorPen.Width = 4
.MinorPen.VtColor.Set 0, 0, 255
.MinorPen.Width = 2
End With
End Sub