黑马程序猿的python学习视频:https://www.bilibili.com/video/BV1qW4y1a7fU/
===============================================================
目录
1. 基础地图
2. 设置分段
1. 基础地图
from pyecharts.charts import Map # 准备地图对象 map = Map() # 准备数据 data=[ ("北京",99), ("上海",199), ("广州",299) ] # 添加数据 map.add("测试下",data,"china") # 绘图 map.render() |
2. 设置分段
from pyecharts.charts import Map from pyecharts.options import VisualMapOpts # 准备地图对象 map = Map() # 准备数据 data=[ ("北京市",99), ("上海市",199) ] # 添加数据 map.add("测试下",data,"china") # 设置全局选项 map.set_global_opts( visualmap_opts=VisualMapOpts( is_show=True, is_piecewise=True, pieces=[ {"min":1,"max":99,"label":'1-9',"color":"#115ED"}, {"min":100,"max":199,"label":'100-199',"color":"#CFB0B"}, {"min":200,"max":299,"label":'200-299',"color":"#FF33FF"} ] ) ) # 绘图 map.render() |