当前位置:网站首页>[OA] excel document generator: openpyxl module
[OA] excel document generator: openpyxl module
2022-07-07 04:12:00 【Allen Moore】
Openpyxl modular
1. Area map Area Chart
from openpyxl import Workbook
from openpyxl.chart import (
AreaChart,
Reference,
Series,
)
wb = Workbook()
ws = wb.active
rows = [
[' Serial number ', ' batch 1', ' batch 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 = " Area map "
chart.style = 13
chart.x_axis.title = ' test '
chart.y_axis.title = ' percentage '
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(" Example of area map .xlsx")
边栏推荐
- golang 压缩和解压zip文件
- Machine learning notes - bird species classification using machine learning
- 一些常用软件相关
- 史上最全MongoDB之Mongo Shell使用
- Pyqt5 out of focus monitoring no operation timer
- POJ training plan 2253_ Frogger (shortest /floyd)
- ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed directly
- 史上最全学习率调整策略lr_scheduler
- Class constant pool and runtime constant pool
- 三重半圆环进度条,直接拿去就能用
猜你喜欢
Gpt-3 is a peer review online when it has been submitted for its own research
opencv第三方库
Imitate Tengu eating the moon with Avatar
Summer 2022 daily question 1 (1)
力扣------路径总和 III
科兴与香港大学临床试验中心研究团队和香港港怡医院合作,在中国香港启动奥密克戎特异性灭活疫苗加强剂临床试验
[MySQL] row sorting in MySQL
tflite模型转换和量化
SSM+JSP实现企业管理系统(OA管理系统源码+数据库+文档+PPT)
Arduino droplet detection
随机推荐
Summer 2022 daily question 1 (1)
Web service performance monitoring scheme
List interview common questions
[record of question brushing] 2 Add two numbers
2022 electrician cup a question high proportion wind power system energy storage operation and configuration analysis ideas
True Global Ventures新成立的1.46亿美元后续基金关账,其中普通合伙人认缴6,200万美元以对后期阶段的Web3赢家进行投资
使用切面实现记录操作日志
Storage of data
2022电工杯A题高比例风电电力系统储能运行及配置分析思路
HW notes (II)
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
Food Chem | in depth learning accurately predicts food categories and nutritional components based on ingredient statements
tflite模型转换和量化
【OA】Excel 文档生成器: Openpyxl 模块
再AD 的 界面顶部(菜单栏)创建常用的快捷图标
Arduino droplet detection
Learn how to use js to merge two objects into one object assign()
史上最全MongoDB之Mongo Shell使用
How to write a resume that shines in front of another interviewer [easy to understand]
map和set的实现