Axes 集合对象

         
Charts (Chart)
Axes (Axis)
AxisTitle
Border
Gridlines
TickLabels

指定图表中所有 Axis 对象的集合。

Axes 集合对象的的用法

可用 Axes 方法返回 Axes 集合。下例显示第一张工作表上嵌入的第一个图表中的坐标轴数目。

With Worksheets(1).ChartObjects(1).Chart
    MsgBox .Axes.Count
End With

可用 Axes(typegroup) 返回单个 Axis 对象,其中 type 为坐标轴类型,而 group 为坐标轴组。Type 可为以下 XlAxisType 常量之一:xlCategoryxlSeriesxlValueGroup 可为以下 xlSecondary 常量之一:xlPrimaryxlSecondary。有关详细信息,请参阅 Axes 方法。

下例设置图表工作表 1 中分类轴的标题文字。

With Charts("chart1").Axes(xlCategory)
    .HasTitle = True
    .AxisTitle.Caption = "1994"
End With