主题
Top (属性)
返回或设置一个 float 值,它代表从对象的上边缘到工作表第一行顶部或图表上的图表区顶部的距离(以磅为单位)。
示例
python
#此示例使工作表 Sheet1 中所有图表的上边界与工作表第五行的上边界对齐
def test():
sheet = Application.Worksheets.Item("Sheet1")
sheet.ChartObjects().Top = sheet.Rows.Item(5).Top
python
#此示例显示图表工作表 Chart1 中图表到该表顶部的距离
def test():
chartobjects = Application.Charts.Item("Chart1").ChartObjects()
print(f"到顶部的距离为:{chartobjects.Top} 磅")