Miss_leaf 2020-01-30 11:11 采纳率: 0%
浏览 2145

Python->Pyecharts->Geo在地图中加入自定义的点报错:AttributeError: 'NoneType' object has no attribute 'add'。

Geo在地图中加入自定义的点报错:
AttributeError: 'NoneType' object has no attribute 'add'

原码:

from example.commons import Faker
from pyecharts import options as opts
from pyecharts.charts import Geo
from pyecharts.globals import ChartType, SymbolType
import pandas as pd
import json


# 链式调用
c = (
    Geo()
        .add_schema(maptype="world")
        # 加入自定义的点,格式为
        .add_coordinate("测试点", 116.39770014211535, 39.90779994986951)
        # 为自定义的点添加属性
        .add("geo", [("测试点", 51)])
        .set_series_opts(label_opts=opts.LabelOpts(is_show=False))
        .set_global_opts(title_opts=opts.TitleOpts(title="宇宙中心呼唤爱"))
)
# 在 html(浏览器) 中渲染图表
c.render()
# 在 Jupyter Notebook 中渲染图表
c.render_notebook()

报错:

.add_coordinate("测试点", 116.39770014211535, 39.90779994986951)

AttributeError: 'NoneType' object has no attribute 'add'

  • 写回答

3条回答

  • tranlynn_lau 2020-01-30 15:50
    关注

    我也想知道怎么解决,同问。

    评论

报告相同问题?

悬赏问题

  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式