python pyecharts 地图上缺少数据点1?

python pyecharts 地图上缺少数据点1?

from pyecharts import options as opts

from pyecharts.charts import Geo

from pyecharts.globals import ChartType, SymbolType

c = (

Geo()

.add_schema(maptype="钦州",itemstyle_opts=opts.ItemStyleOpts(color="#003366", border_color="#fff"),)

.add(

"",

[['灵山县', 1], ['钦南区', 2], ['钦北区', 3], ['浦北县', 4], ['港口', 5]],

type_=ChartType.EFFECT_SCATTER,

color="white",

)

.set_series_opts(label_opts=opts.LabelOpts(is_show=False))

.set_global_opts(title_opts=opts.TitleOpts(title="钦州"))

.render("../web/map.html")

)

from IPython.display import IFrame

IFrame("http://127.0.0.1/web/map.html",width=1024,height=600)

得出的结果中少了钦南区的点 不知道是哪不对


回答:

pyecharts包路径下Lib/site-packages/pyecharts/datasets/city_coordinates.json文件无钦南区、港口坐标,
可参考此文档https://github.com/pyecharts/...自定义添加坐标即可

以上是 python pyecharts 地图上缺少数据点1? 的全部内容, 来源链接: utcz.com/p/938581.html

回到顶部