2013-10-01 91 views
1

我已經提出了問題並得到了點的響應。 create point in graph using xslwriter在散點圖中創建點圖

我想添加與'type': 'scatter','subtype' : 'straight'相同的功能和標記添加系列但最終以下選項。

File "C:\Python27\lib\site-packages\xlsxwriter\workbook.py", line 386, in _store_workbook 
    packager._create_package() 
    File "C:\Python27\lib\site-packages\xlsxwriter\packager.py", line 122, in _create_package 
    self._write_chart_files() 
    File "C:\Python27\lib\site-packages\xlsxwriter\packager.py", line 205, in _write_chart_files 
    chart._assemble_xml_file() 
    File "C:\Python27\lib\site-packages\xlsxwriter\chart.py", line 525, in _assemble_xml_file 
    self._write_chart() 
    File "C:\Python27\lib\site-packages\xlsxwriter\chart.py", line 1158, in _write_chart 
    self._write_plot_area() 
    File "C:\Python27\lib\site-packages\xlsxwriter\chart_scatter.py", line 168, in _write_plot_area 
    self._write_chart_type({'primary_axes': 1}) 
    File "C:\Python27\lib\site-packages\xlsxwriter\chart_scatter.py", line 52, in _write_chart_type 
    self._write_scatter_chart(args) 
    File "C:\Python27\lib\site-packages\xlsxwriter\chart_scatter.py", line 91, in _write_scatter_chart 
    self._modify_series_formatting() 
    File "C:\Python27\lib\site-packages\xlsxwriter\chart_scatter.py", line 284, in _modify_series_formatting 
    if series['marker'] is None or not series['marker']['defined']: 
KeyError: 'defined' 

回答

0

您需要定義子類型爲straight_with_markers

嘗試這樣:

chart = workbook.add_chart({'type': 'scatter', 
          'subtype': 'straight_with_markers'})