xlwings设置Excel的图表chart的标题

import xlwings as xw

app = xw.App(visible=False, add_book=False)
wbk = app.books.open('test.xlsx')
sht = wbk.sheets['chartsheet']

title = 'hello world'
sht.charts['图表 1'].api[1].ChartTitle.Text = title

wbk.save()
wbk.close()
app.quit()

猜你喜欢

转载自blog.csdn.net/u012550037/article/details/83615838