# 导入相关模块
from pyecharts.charts import Bar
from pyecharts import options as opts
from pyecharts.charts import Line
import os
# excel处理模块 读:xlrd(read),写:xlrd(write)
import xlrd
# 读取excel文件
data = xlrd.open_workbook(r'D:\xlsx\db\xxx统计分析.xlsx')
# 通过索引读取sheet表
# table = data.sheets()[1]
sheet_list = data.sheet_names()
# print(sheet_list)
for x in range(1,len(sheet_list)):
table = data.sheets()[x]
# 通过表名读取
# table = data.sheet_by_name('华中-xxx有限公司')
# 打印表的行数,列数
# print(table.nrows,table.ncols)
# 存放时间,超速,振动,负载,点检,离位列表
time_list = []
cs_list = []
zd_list = []
fz_list = []
dj_list = []
lw_list = []
# 将需要展示的数据行和列加入列表
for i in range(1,table.nrows):
     # x轴坐标数据
   time_list.append(table.row_values(i)[0])
# y轴坐标数据
     cs_list.append(table.row_values(i)[3])
zd_list.append(table.row_values(i)[4])
fz_list.append(table.row_values(i)[5])
dj_list.append(table.row_values(i)[6])
lw_list.append(table.row_values(i)[7])
# 折线图
line = Line()
line.add_xaxis(time_list)
line.add_yaxis('超速',cs_list)
line.add_yaxis('振动',zd_list)
line.add_yaxis('负载',fz_list)
line.add_yaxis('点检',dj_list)
line.add_yaxis('离位',lw_list)
# line.set_colors(['red','green','blue','black','fuscia'])
# 设置图表标题及子标题
  line.set_global_opts(opts.TitleOpts(title="华中", subtitle=sheet_list[x]))
if sheet_list[x]:
line.render(sheet_list[x])
os.replace(sheet_list[x],sheet_list[x] + '.html')
# 展示效果

最新文章

  1. 由objC运行时所想到的。。。
  2. 利用IIS应用请求转发ARR实现IIS和tomcat整合共用80端口
  3. 64位ubuntu下重新编译hadoop2.2流水账
  4. PCA理论与实践
  5. Angular系列----AngularJS入门教程02:静态模板(转载)
  6. “耐撕”团队2016.04.19站立会议
  7. 学习c的第6天2
  8. 用JDBC访问ORACLE数据库 关于commit 增快效率 大数据 等的整理
  9. 关于unsigned int和int的加法
  10. BZOJ 3357: [Usaco2004]等差数列( dp )
  11. 向EXECL文件中导入数据的同时插入图片
  12. 一步一步创建ASP.NET MVC5程序[Repository+Autofac+Automapper+SqlSugar](八)
  13. Eclipse安装hibernate插件
  14. cocos creator 碰撞检测
  15. java java.net.URLConnection 实现http get,post
  16. 工控随笔_19_西门子_WinCC的VBS脚本_08_常量和流程控制_01
  17. 深入C#的String类
  18. 【java】注释
  19. 尚硅谷springboot学习9-配置文件值注入
  20. 第四章-shceme和数据类型优化

热门文章

  1. 摄像头与毫米波雷达(Radar)融合
  2. YOLOv5目标检测源码重磅发布了!
  3. CPU,GPU,GPGPU
  4. 基于TensorRT优化的Machine Translation
  5. C# & JS 判断字符串是否为日期格式
  6. springboot——发送put、delete请求
  7. hbase统计表的行数的三种方法
  8. 如何提升springboot服务吞吐量
  9. SpringBoot_登录注册
  10. 温故而知新--day5