当前位置:网站首页>[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")
边栏推荐
- [hcie TAC] question 3
- cuda编程
- Food Chem | in depth learning accurately predicts food categories and nutritional components based on ingredient statements
- Gpt-3 is a peer review online when it has been submitted for its own research
- tflite模型转换和量化
- HW notes (II)
- Redis source code learning (30), dictionary learning, dict.h
- Tflite model transformation and quantification
- 机器人(自动化)课程的持续学习-2022-
- One of oscp tools: dirsearch usage Encyclopedia
猜你喜欢
Mongo shell, the most complete mongodb in history
QT opens a file and uses QFileDialog to obtain the file name, content, etc
Some common software related
Machine learning notes - bird species classification using machine learning
CUDA Programming
史上最全学习率调整策略lr_scheduler
The most complete security certification of mongodb in history
Some thoughts on cross end development of kbone and applet
Summer 2022 daily question 1 (1)
[record of question brushing] 2 Add two numbers
随机推荐
NoSQL之Redis配置与优化
Ggplot facet detail adjustment summary
How to detect whether the MySQL code runs deadlock +binlog view
2022中青杯C题城市交通思路分析
PHP implements lottery according to probability
How to manage the expiration of enterprise distribution certificates- How to manage Enterprise Distribution certificate expiration?
cuda编程
機器人(自動化)課程的持續學習-2022-
你心目中的数据分析 Top 1 选 Pandas 还是选 SQL?
【开发软件】 tilipa开发者软件
2022年电工杯B 题 5G 网络环境下应急物资配送问题思路分析
DAB-DETR: DYNAMIC ANCHOR BOXES ARE BETTER QUERIES FOR DETR翻译
使用 Dumpling 备份 TiDB 集群数据到 GCS
Kotlin Compose Text支持两种颜色
如何编写一个程序猿另一个面试官眼前一亮的简历[通俗易懂]
Adaptive non European advertising retrieval system amcad
The first introduction of the most complete mongodb in history
机械臂速成小指南(十):可达工作空间
Do you choose pandas or SQL for the top 1 of data analysis in your mind?
硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件