Skip to content
本页内容

Width (属性)

返回或设置一个 float 值,它代表对象的宽度(以磅为单位)。

示例

python
#此示例设置工作表 Sheet1 中第一张图表的宽度为 360 磅
def test():
    chartobject = Application.Worksheets.Item("Sheet1").ChartObjects(1)
    chartobject.Width = 360
python
#此示例显示第一张工作表中图表 Chart 2 的宽度
def test():
    chartobject = Application.Worksheets.Item(1).ChartObjects("Chart 2")
    print(f"图表 Chart 2 的宽度:{chartobject.Width} 磅")