Skip to content
本页内容

Top (属性)

返回或设置一个 float值,它代表从对象的上边缘到图表上的图表区顶部的距离(以磅为单位)。

示例

python
#此示例将图表工作表 Chart1 中图表标题设置为可见,并显示标题到图表顶部的距离
def test():
    chart = Application.Charts.Item("Chart1").ChartObjects(1).Chart
    chart.HasTitle = True
    print(f"标题到顶部的距离为 {chart.ChartTitle.Top} 磅")
python
#此示例显示工作表 Sheet1 中第一张图表的图表标题到图表顶部的距离是否为 6 磅
def test():
    charttitle = Application.Sheets.Item("Sheet1").ChartObjects(1).Chart.ChartTitle
    print(charttitle.Top == 6)