运行界面:
应该加上label。
用到的文本:
("广州", 55),
("北京", 66),
("杭州", 77),
("重庆", 88),
("哈尔滨",39),
("乌鲁木齐",20)
("广州", "上海"),
("广州", "北京"),
("广州", "杭州"),
("广州", "重庆"),
("青岛", "哈尔滨"),
("北京", "乌鲁木齐"),
运行结果:
代码:
扫描二维码关注公众号,回复:
12885726 查看本文章

'''
Created by catpy.
2020/6/9 11:22:05
'''
import os
from pyecharts import options as opts
from pyecharts.charts import Geo
from pyecharts.globals import ChartType, SymbolType
c = (
Geo()
.add_schema(
maptype="china",
itemstyle_opts=opts.ItemStyleOpts(color="#323c48", border_color="#111"),
)
.add(
"",
[###[name:memo1,type:memo,left:20,top:20,width:370,height:100,scrollbars:ssAutoBoth,]###],
type_=ChartType.EFFECT_SCATTER,
color="white",
)
.add(
"方向",
[###[name:memo2,type:memo,left:20,top:140,width:370,height:100,scrollbars:ssAutoBoth,]###],
type_=ChartType.LINES,
effect_opts=opts.EffectOpts(
symbol=SymbolType.ARROW, symbol_size=6, color="blue"
),
linestyle_opts=opts.LineStyleOpts(curve=0.2),
)
.set_series_opts(label_opts=opts.LabelOpts(is_show=False))
.set_global_opts(title_opts=opts.TitleOpts(title="国内航班"))
.render("geo_lines_background.html")
)
os.system(c)