您好,登錄后才能下訂單哦!
import xlsxwriter workbook=xlsxwriter.Workbook('chart.xlsx') sheet1=workbook.add_worksheet('chart') bold=workbook.add_format() bold.set_bold() title=['kemu','ke1','ke2','ke3','ke4'] data=[['zhangsan',60,85,75,100],['lisi',78,89,67,30],['wangwu',77,66,89,98]] mychart = workbook.add_chart({'type':'column'}) sheet1.write_row('G1',title,bold) for i in range(len(data)): row=i+2 sheet1.write_row('G{}'.format(row),data[i]) mychart.add_series({'name':'=chart!$G${}'.format(row), 'categories':'=chart!$H$1:$L$1', 'values':'=chart!$H${}:$L${}'.format(row,row)}) mychart.set_title({'name':'this is a test'}) sheet1.insert_chart('G10',mychart) workbook.close()
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。