如何使用openpyxls将数据表添加到图表空间?

2024-10-01 13:44:59 发布

您现在位置:Python中文网/ 问答频道 /正文

openpyxl中有一个openpyxl.chart.chartspace.DataTable类,但是没有示例。当我尝试使用它时,我得到:

AttributeError: 'BarChart' object has no attribute 'DataTable' 

或者我无法在图表空间中使用以下代码获取数据表:

from openpyxl.chart.chartspace import DataTable

chart1 = BarChart()
chart1.DataTable = DataTable(showHorzBorder=None , showVertBorder=None,showOutline=None, showKeys=None, spPr=None,txPr=None, extLst=None)

Tags: nonone示例objectchart图表空间attribute