标签:tle for map jin 用户 data 20px single beijing
用于带有起点和终点信息的线数据的绘制,主要用于地图上的航线,路线的可视化。
GeoLines.add() 方法签名
1 add(name, data, 2 maptype=‘china‘, 3 symbol=None, 4 symbol_size=12, 5 border_color="#111", 6 geo_normal_color="#323c48", 7 geo_emphasis_color="#2a333d", 8 geo_cities_coords=None, 9 geo_effect_period=6, 10 geo_effect_traillength=0, 11 geo_effect_color=‘#fff‘, 12 geo_effect_symbol=‘circle‘, 13 geo_effect_symbolsize=5, 14 is_geo_effect_show=True, 15 is_roam=True, **kwargs)
默认效果
1 from pyecharts import GeoLines, Style 2 3 style = Style( 4 title_top="#fff", 5 title_pos = "center", 6 width=1200, 7 height=600, 8 background_color="#404a59" 9 ) 10 11 data_guangzhou = [ 12 ["广州", "上海"], 13 ["广州", "北京"], 14 ["广州", "南京"], 15 ["广州", "重庆"], 16 ["广州", "兰州"], 17 ["广州", "杭州"] 18 ] 19 geolines = GeoLines("GeoLines 示例", **style.init_style) 20 geolines.add("从广州出发", data_guangzhou, is_legend_show=False) 21 geolines.render()
稍加配置
1 from pyecharts import GeoLines, Style 2 3 style_geo = style.add( 4 is_label_show=True, 5 line_curve=0.2, 6 line_opacity=0.6, 7 legend_text_color="#eee", 8 legend_pos="right", 9 geo_effect_symbol="plane", 10 geo_effect_symbolsize=15, 11 label_color=[‘#a6c84c‘, ‘#ffa022‘, ‘#46bee9‘], 12 label_pos="right", 13 label_formatter="{b}", 14 label_text_color="#eee", 15 ) 16 geolines = GeoLines("GeoLines 示例", **style.init_style) 17 geolines.add("从广州出发", data_guangzhou, **style_geo) 18 geolines.render()
指定数值
1 from pyecharts import GeoLines, Style 2 3 data_guangzhou = [ 4 ["广州", "上海", 10], 5 ["广州", "北京", 20], 6 ["广州", "南京", 30], 7 ["广州", "重庆", 40], 8 ["广州", "兰州", 50], 9 ["广州", "杭州", 60], 10 ] 11 lines = GeoLines("GeoLines 示例", **style.init_style) 12 lines.add( 13 "从广州出发", data_guangzhou, tooltip_formatter="{a} : {c}", **style_geo 14 ) 15 lines.render()
多例模式
1 from pyecharts import GeoLines, Style 2 3 data_beijing = [ 4 ["北京", "上海"], 5 ["北京", "广州"], 6 ["北京", "南京"], 7 ["北京", "重庆"], 8 ["北京", "兰州"], 9 ["北京", "杭州"] 10 ] 11 geolines = GeoLines("GeoLines 示例", **style.init_style) 12 geolines.add("从广州出发", data_guangzhou, **style_geo) 13 geolines.add("从北京出发", data_beijing, **style_geo) 14 geolines.render()
单例模式,指定 legend_selectedmode="single"
1 from pyecharts import GeoLines, Style 2 3 style_geo = style.add( 4 is_label_show=True, 5 line_curve=0.2, 6 line_opacity=0.6, 7 legend_text_color="#eee", 8 legend_pos="right", 9 geo_effect_symbol="plane", 10 geo_effect_symbolsize=15, 11 label_color=[‘#a6c84c‘, ‘#ffa022‘, ‘#46bee9‘], 12 label_pos="right", 13 label_formatter="{b}", 14 label_text_color="#eee", 15 legend_selectedmode="single", #指定单例模式 16 ) 17 geolines = GeoLines("GeoLines 示例", **style.init_style) 18 geolines.add("从广州出发", data_guangzhou, **style_geo) 19 geolines.add("从北京出发", data_beijing, **style_geo) 20 geolines.render()
用于带有起点和终点信息的线数据的绘制,主要用于地图上的航线,路线的可视化。
标签:tle for map jin 用户 data 20px single beijing
原文地址:https://www.cnblogs.com/Python6359/p/9116829.html