当前位置:网站首页>[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")
边栏推荐
- 2022 electrician cup a question high proportion wind power system energy storage operation and configuration analysis ideas
- Redis source code learning (30), dictionary learning, dict.h
- POJ training plan 2253_ Frogger (shortest /floyd)
- 机械臂速成小指南(十):可达工作空间
- Restore backup data on GCS with br
- What is the experience of maintaining Wanxing open source vector database
- Ggplot facet detail adjustment summary
- QT item table new column name setting requirement exercise (find the number and maximum value of the array disappear)
- 手机号国际区号JSON格式另附PHP获取
- 三重半圆环进度条,直接拿去就能用
猜你喜欢
5年自动化测试,终于进字节跳动了,年薪30w其实也并非触不可及
史上最全MongoDB之安全认证
[record of question brushing] 2 Add two numbers
Top 50 hit industry in the first half of 2022
[development software] tilipa Developer Software
Some thoughts on cross end development of kbone and applet
ABAP Dynamic Inner table Group cycle
如何检测mysql代码运行是否出现死锁+binlog查看
【mysql】mysql中行排序
Antd comment recursive loop comment
随机推荐
The most complete security certification of mongodb in history
Using thread class and runnable interface to realize the difference between multithreading
Use dumping to back up tidb cluster data to GCS
vim —- 自己主动的按钮indent该命令「建议收藏」
Redis source code learning (30), dictionary learning, dict.h
【开发软件】 tilipa开发者软件
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
手机号国际区号JSON格式另附PHP获取
学习使用js把两个对象合并成一个对象的方法Object.assign()
2022 electrician cup a question high proportion wind power system energy storage operation and configuration analysis ideas
史上最全MongoDB之部署篇
One of oscp tools: dirsearch usage Encyclopedia
机器人(自动化)课程的持续学习-2022-
2022电工杯A题高比例风电电力系统储能运行及配置分析思路
Machine learning notes - bird species classification using machine learning
数据的存储
Analysis on the thinking of college mathematical modeling competition and curriculum education of the 2022a question of the China Youth Cup
PHP implements lottery according to probability
The most complete learning rate adjustment strategy in history LR_ scheduler
使用 TiDB Lightning 恢复 GCS 上的备份数据