def save_excel(count_dict, file_name):
book = xlsxwriter.Workbook(r'E:\positions\%s.xls' % file_name)
tmp = book.add_worksheet()
row_num = len(count_dict)
for i in range(1, row_num):
if i == 1:
tag_pos = 'A%s' % i
tmp.write_row(tag_pos, ['???', '??'])
else:
con_pos = 'A%s' % i
k_v = list(count_dict[i-2])
tmp.write_row(con_pos, k_v)
chart1 = book.add_chart({'type':'area'})
chart1.add_series({
'name' : '=Sheet1!$B$1',
'categories' : '=Sheet1!$A$2:$A$80',
'values' : '=Sheet1!$B$2:$B$80'
})
chart1.set_title({'name':'?????'})
chart1.set_x_axis({'name': '???'})
chart1.set_y_axis({'name': '??(/?)'})
tmp.insert_chart('C2', chart1, {'x_offset':15, 'y_offset':10})
book.close()
评论列表
文章目录