主题
Chart (属性)
返回 Chart 对象,该对象代表形状区域中包含的图表。只读。
示例
python
#本示例将第一张工作表中新建的ShapeRange对象的图表标题设置为“销售数量”
def test():
shpRange = Application.Worksheets.Item(1).Shapes.Range([1])
chart = shpRange.Chart
chart.HasTitle = True
chart.ChartTitle.Text = "销售数量"
python
#本示例将活动工作表中新建的ShapeRange对象的图表类别坐标轴标题设置为“月份”
def test():
shpRange = ActiveSheet.Shapes.Range([2])
chart = shpRange.Chart
chart.Axes(xlCategory).HasTitle = True
chart.Axes(xlCategory).AxisTitle.Text = "月份"