from bs4 import BeautifulSoup from pyecharts import options as opts from pyecharts.charts import Line, Liquid, Pie, Page,Radar, Geo, Scatter3D, WordCloud, EffectScatter, Tree import random from pyecharts.globals import SymbolType def tab1(name, color): # 标题 c = (Pie(). set_global_opts( title_opts=opts.TitleOpts(title=name, pos_left='center', pos_top='center', title_textstyle_opts=opts.TextStyleOpts(color=color, font_size=25)))) return c def line(): # 折线图 data = ["1月", "2月", "3月", "4月", "5月"] high_temperature = [11, 13, 18, 22, 28] low_temperature = [-3, -2, 10, 13, 14] c = ( Line() .add_xaxis(data) .add_yaxis("最高气温", high_temperature) .add_yaxis("最低气温", low_temperature) .set_global_opts(title_opts=opts.TitleOpts(title="气温变化")) #.render("line_base.html") ) return c #水球图 def liquid(): c = ( Liquid() .add('lq', [0.5, 0.4], color=['blue'], is_animation=True, is_outline_show=True) .set_global_opts(title_opts=
Python:制作天气数据可视化大屏
最新推荐文章于 2024-05-28 15:55:45 发布
from bs4 import BeautifulSoupfrom pyecharts import options as optsfrom pyecharts.charts import Line, Liquid, Pie, Page,Radar, Geo, Scatter3D, WordCloud, EffectScatter, Treeimport randomfrom pyecharts.globals import SymbolTypedef tab1(name, color): .
摘要由CSDN通过智能技术生成