Skip to content

请问Pyecharts V1.0.0 如何导入美国地图? #1372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ZhangB0426 opened this issue Oct 14, 2019 · 1 comment
Closed

请问Pyecharts V1.0.0 如何导入美国地图? #1372

ZhangB0426 opened this issue Oct 14, 2019 · 1 comment

Comments

@ZhangB0426
Copy link

你好,我想利用Pyecharts在美国地图上面打点,但是不知道怎样只导入美国地图?

@sunhailin-Leo
Copy link
Member

@ZhangB0426

from pyecharts import options as opts
from pyecharts.charts import Map
from pyecharts.faker import Collector, Faker
from pyecharts.datasets import register_url

# 如果出现 ssl 异常再加下面这两行
# import ssl
# ssl._create_default_https_context = ssl._create_unverified_context

register_url("https://echarts-maps.github.io/echarts-countries-js/")
c = (
    Map()
    .add("商家A", [["Ohio", 100]], "美国")
    .set_global_opts(title_opts=opts.TitleOpts(title="Map-基本示例"))
    .render()
)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants