山东泰润建设集团网站,wordpress100万数据,网站原型,wordpress ping地址pyecharts 是一个用于生成 Echarts 图表的类库。 Echarts 是百度开源的一个数据可视化 JS 库。可以生成很多效果很棒的图表。 pycharts文档 |分割| echarts官网
本文主要介绍pycharts的简单使用 安装
# 安装 1.0.x 以上版本 #xff08;需要python3.6及以上#xff09;
$ …pyecharts 是一个用于生成 Echarts 图表的类库。 Echarts 是百度开源的一个数据可视化 JS 库。可以生成很多效果很棒的图表。 pycharts文档 |分割| echarts官网
本文主要介绍pycharts的简单使用 安装
# 安装 1.0.x 以上版本 需要python3.6及以上
$ pip install pyecharts -U# 安装 0.5.x 不建议因为不再维护python3.5及以下可以安装
# pip install pyecharts0.5.11简单示例
# pycharts可以生成很多种类的图表如基本图表柱状图、折线图、3D图等等。
# 生成不同的图表需要导入不同的模块。本文只介绍柱状图和3D柱状图
# 柱状图
from pyecharts import options as optsfrom pyecharts.charts import Barx [haha, hahaha, hahahaha, hehe, hehehe, hehehehe]y1 [56, 90, 68, 56, 34, 9]y2 [3, 45, 45, 67, 8, 45]c (Bar().add_xaxis(x) # 生成x轴.add_yaxis(第一个柱状图, y1).add_yaxis(第二个柱状图, y2).set_global_opts(title_optsopts.TitleOpts(titleBar-大标题, subtitleBar-副标题)) # 生成标题.render(filename.html) # 生成对应图表的html文件)生成的示例图
# 3D柱状图
def bar3d_base():# data [[x,y,z], [x,y,z], [x,y,z], ...]# data1 [[1, 0, 7]]# data2 [[4, 0, 1]]# 主标题name 这是一个3D柱状图# 最大值num 15c (Bar3D(init_optsopts.InitOpts(width1600px, height800px))# 可以写多个 add() .add(series_namehahaha,# x, y, z 数据datadata1,xaxis3d_optsopts.Axis3DOpts(type_category, name时间),yaxis3d_optsopts.Axis3DOpts(type_category, nameid),zaxis3d_optsopts.Axis3DOpts(type_value, name次数),).add(series_namehehehe,# x, y, z 数据datadata2,xaxis3d_optsopts.Axis3DOpts(type_category, name时间),yaxis3d_optsopts.Axis3DOpts(type_category, nameid),zaxis3d_optsopts.Axis3DOpts(type_value, name次数),).set_global_opts(visualmap_optsopts.VisualMapOpts(# 最大值max_num,range_color[#313695,#4575b4,#74add1,#abd9e9,#e0f3f8,#ffffbf,#fee090,#fdae61,#f46d43,#d73027,#a50026,],),title_optsopts.TitleOpts(titlename),).render(filename.html) # 可以在这里保存 生成的图表 是一个HTML文件)# 也可以在别的地方 c.render(filename.html)生成的示例图