当前位置:网站首页>[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")

边栏推荐
- 1.19.11.SQL客户端、启动SQL客户端、执行SQL查询、环境配置文件、重启策略、自定义函数(User-defined Functions)、构造函数参数
- ABAP dynamic inner table grouping cycle
- 科兴与香港大学临床试验中心研究团队和香港港怡医院合作,在中国香港启动奥密克戎特异性灭活疫苗加强剂临床试验
- Implementation of binary search tree
- golang 根据生日计算星座和属相
- 【mysql】mysql中行排序
- Kotlin Android environment construction
- [development software] tilipa Developer Software
- [leetcode]Spiral Matrix II
- How to manage the expiration of enterprise distribution certificates- How to manage Enterprise Distribution certificate expiration?
猜你喜欢

Simple implementation of AVL tree insertion and verification operations

Operational amplifier application summary 1

【刷题记录】2. 两数相加

硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件

Kotlin Android environment construction

史上最全MongoDB之安全认证

QT item table new column name setting requirement exercise (find the number and maximum value of the array disappear)

【ArcGIS教程】专题图制作-人口密度分布图——人口密度分析

When QT uses qtooltip mouse to display text, the picture of the button will also be displayed and the prompt text style will be modified

How to detect whether the MySQL code runs deadlock +binlog view
随机推荐
golang 根据生日计算星座和属相
leetcode:面试题 17.24. 子矩阵最大累加和(待研究)
Imitate Tengu eating the moon with Avatar
Gpt-3 is a peer review online when it has been submitted for its own research
Opencv third party Library
10 ways of interface data security assurance
2022年电工杯B 题 5G 网络环境下应急物资配送问题思路分析
科兴与香港大学临床试验中心研究团队和香港港怡医院合作,在中国香港启动奥密克戎特异性灭活疫苗加强剂临床试验
一些常用软件相关
【编码字体系列】OpenDyslexic字体
Arduino droplet detection
Antd comment recursive loop comment
What is the experience of maintaining Wanxing open source vector database
史上最全MongoDB之安全认证
How to manage the expiration of enterprise distribution certificates- How to manage Enterprise Distribution certificate expiration?
Machine learning notes - bird species classification using machine learning
【knife-4j 快速搭建swagger】
【系统管理】清理任务栏的已删除程序的图标缓存
手机号国际区号JSON格式另附PHP获取
The most complete learning rate adjustment strategy in history LR_ scheduler