天气数据分析预测可视化分析预测系统
01开发环境
1.1 Python技术
1.2 MySQL数据库
1.3 B/S 结构
1.4 Vue.js 技术
02系统图片展示
03代码展示
# 省份或者城市地图# (学习交流+VX:S20231025S )DEFAULT_HOST="https://assets.pyecharts.org/assets/v5/"NOTEBOOK_HOST="http://localhost:8888/nbextensions/assets/"defget_citymap(data=None):CurrentConfig.ONLINE_HOST=DEFAULT_HOSTfrompyecharts.chartsimportMapfrompyecharts.fakerimportFaker# https://assets.pyecharts.org/assets/v5/maps/guangdong.js 从这个网址获取各个省份的jsifnotdata:data=[list(z)forzinzip(Faker.guangdong_city,Faker.values())]else:data=data city=(Map().add("",data,"吉林").set_global_opts(title_opts=opts.TitleOpts(title="",is_show=False),visualmap_opts=opts.VisualMapOpts(is_show=False,min_=1000,max_=1200)))city.width='100%'city.height='100%'city_html=city.render_embed()returncity_html# 中国地图defget_map(data=None,title=None,tcolor=None,legendtext=None,legendtextcolor=None):CurrentConfig.ONLINE_HOST="static/official/"frompyecharts.chartsimportMapifnotdata:data=[('山西省',123)]else:data=dataifnottitle:title='地图'else:title=titleifnottcolor:tcolor="#000000"else:tcolor=tcolorifnotlegendtext:legendtext=""else:legendtext=legendtextifnotlegendtextcolor:legendtextcolor="#000000"else:legendtextcolor=legendtextcolor c=(Map().add(legendtext,data,"china").set_series_opts(label_opts=opts.LabelOpts(is_show=False)).set_global_opts(title_opts=opts.TitleOpts(title=title,title_textstyle_opts=opts.TextStyleOpts(color=tcolor)),legend_opts=opts.LegendOpts(textstyle_opts=opts.TextStyleOpts(color=legendtextcolor)# 设置图例字体颜色为白色),visualmap_opts=opts.VisualMapOpts()))c.width='100%'c.height='100%'map_html=c.render_embed()returnmap_html