用户:
编程达人政杰查看:1 回复:2 评论:1 创建时间:2022-07-07T15:26:54
【作品展示】

【作品介绍】
一个有亿点难的程序
【作品源代码】
from pyecharts import GeoLines, Style
import webbrowser
import os
import json
with open("site.json", "r", encoding="utf-8-sig") as f:
coords = json.load(f)
print(coords)
style = Style(
width=1300,
height=700,
background_color="#c19d65",
title_color="red",
title_pos="center",
)
style_geo = style.add(
geo_cities_coords=coords,
geo_normal_color="#c7d9f1",
geo_emphasis_color="#ddbd74",
border_color="#ffffff",
legend_text_color=["#bb4fgc", "#5d3ab6", "#2d2f71"],
legend_pos="right",
label_color=["#bb4fgc", "# 5d3ab6", "g2d2f71"],
label_pos="right",
label_formattar="{b}:{a}",
label_text_color=["#bb4fsc", "#5d3ab6", "#2d2f72"],
is_label_show=True,
line_curve=0.2,
geo_effect_symbol="plane",
geo_effect_symbolsize=13,
geo_effect_traillength=0.82,
geo_effect_color=["#bb4f8c",'#5d3ab6',"#2d2f71"]
)
caojun_assault = [
["新野", "襄阳"],
["襄阳", "长坂坡"],
["长坂坡", "江陵"],
["江陵", "乌林"],
]
liujun_assault = [
["樊口", "赤壁战场"]
]
sunjun_assault = [
["柴桑", "樊口"],
["樊口", "赤壁战场"]
]
geolines = GeoLines("赤壁之战", ** style.init_style)
geolines.add("曹军进军路线", caojun_assault, ** style_geo)
geolines.add("孙刘联军进军路线", liujun_assault, **style_geo)
geolines.add("孙军进军路线", sunjun_assault, **style_geo)
geolines.render()
webbrowser.open("file://"+os.path.realpath("render.html"))
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn