当前位置:网站首页>【OA】Excel 文档生成器: Openpyxl 模块
【OA】Excel 文档生成器: Openpyxl 模块
2022-07-06 21:20:00 【Allen Moore】
Openpyxl 模块
1. 面积图 Area Chart
from openpyxl import Workbook
from openpyxl.chart import (
AreaChart,
Reference,
Series,
)
wb = Workbook()
ws = wb.active
rows = [
['序号', '批次 1', '批次 2'],
[2, 40, 30],
[3, 40, 25],
[4, 50, 30],
[5, 30, 10],
[6, 25, 5],
[7, 50, 10],
]
for row in rows:
ws.append(row)
chart = AreaChart()
chart.title = "区域图"
chart.style = 13
chart.x_axis.title = '测试'
chart.y_axis.title = '百分比'
cats = Reference(ws, min_col=1, min_row=1, max_row=7)
data = Reference(ws, min_col=2, min_row=1, max_col=3, max_row=7)
chart.add_data(data, titles_from_data=True)
chart.set_categories(cats)
ws.add_chart(chart, "A10")
wb.save("区域图样例.xlsx")
边栏推荐
- Docker部署Mysql8的实现步骤
- 20. (ArcGIS API for JS) ArcGIS API for JS surface collection (sketchviewmodel)
- Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
- Restcloud ETL Community Edition June featured Q & A
- .net中 接口可以有默认实现了
- 浅谈网络安全之文件上传
- 一些常用软件相关
- Calculation of time and space complexity (notes of runners)
- 使用切面实现记录操作日志
- HW notes (II)
猜你喜欢
Codeworks 5 questions per day (1700 average) - day 7
Que savez - vous de la sérialisation et de l'anti - séquence?
QT 项目 表格新建列名称设置 需求练习(找数组消失的数字、最大值)
Baidu map JS development, open a blank, bmapgl is not defined, err_ FILE_ NOT_ FOUND
自适应非欧表征广告检索系统AMCAD
VHDL implementation of arbitrary size matrix addition operation
Top 50 hit industry in the first half of 2022
21. (article ArcGIS API for JS) ArcGIS API for JS rectangular acquisition (sketchviewmodel)
Construction of Hisilicon universal platform: color space conversion YUV2RGB
ABAP 动态内表分组循环
随机推荐
Code quality management
22. (ArcGIS API for JS) ArcGIS API for JS Circle Collection (sketchviewmodel)
About Confidence Intervals
预处理——插值
Arduino droplet detection
23. (ArcGIS API for JS) ArcGIS API for JS ellipse collection (sketchviewmodel)
VHDL implementation of single cycle CPU design
.net中 接口可以有默认实现了
ubuntu20安裝redisjson記錄
Clock in during winter vacation
map和set的实现
Redis configuration and optimization of NoSQL
C# Task拓展方法
Codeworks 5 questions per day (1700 average) - day 7
Termux set up the computer to connect to the mobile phone. (knock the command quickly), mobile phone termux port 8022
力扣------路径总和 III
SSL证书部署
【DPDK】dpdk样例源码解析之三:dpdk-l3fwd_001
Hongmi K40S root gameplay notes
Mobile measurement and depth link platform - Branch