Building a Chart > Changing the Axis Appearance |
You can customize the appearance of the X, Y, and Y2 axes by changing the tick lengths, colors, and line patterns using the Axes AxisStyle object.
Tick Length
Use the AxisStyle TickLength property to change the length of the ticks on the axis. The IsStyleDefault property allows the chart to set the tick length automatically. These properties are located on the Axis/Gridlines Tab (Axes) on the Property Pages.
' Set tick length on X axis to 5
Chart2D1.ChartArea.Axes("X").AxisStyle.TickLength = 5
Axis Appearance
The AxisStyle object has a LineStyle sub-object that controls the line pattern, thickness, and color properties of the axis lines and ticks. These are located on the AxisStyle Tab (Axes) on the Property Pages, and available via the LineStyle Object.
' Set tick and axis width on X axis to 2
Chart2D1.ChartArea.Axes("X").AxisStyle.LineStyle.Width = 2