用pyecharts制作一个简单的3D地图

# -*- coding: utf-8 -*-
"""
Created on Tue Apr 21 12:12:37 2020

@author: Administrator
"""


from pyecharts import options as opts
from pyecharts.charts import Map
from pyecharts.faker import Faker
from pyecharts.charts import Map3D
from pyecharts.globals import ChartType
from pyecharts.commons.utils import JsCode
from pyecharts.datasets import register_url
from pyecharts.charts import HeatMap

cq_GDP = [["渝北区",1543],["巴南区",781],
                      ["渝中区",1204],["北碚区",552],
                      ["九龙坡区",1211],["南岸区",725],
                      ["江北区",1028],["大渡口区",228],
                      ["沙坪坝区",936]]

c = (
    Map3D(init_opts=opts.InitOpts(width="900px", height="600px"))
    #
    .add_schema(
        maptype="重庆",
        itemstyle_opts=opts.ItemStyleOpts(
            opacity=1,
            border_width=0.8,
        ),
        map3d_label=opts.Map3DLabelOpts(
            is_show=False,
        ),
        emphasis_label_opts=opts.LabelOpts(
            is_show=False, 
            font_size=5,
        ),
        light_opts=opts.Map3DLightOpts(
            main_intensity=1.2,
            main_shadow_quality="high",
            is_main_shadow=False,
            main_beta=10,
            ambient_intensity=0.3,
        ),        

    )

    .add(
        series_name="",
        maptype="重庆",
        data_pair=cq_GDP,
        is_map_symbol_show=False,
    )
    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))#不显示地域名
    .set_global_opts(
        title_opts=opts.TitleOpts(
            title="2018年重庆主城九区GDP",
            subtitle="",

        ),
        visualmap_opts=opts.VisualMapOpts(
            min_=10,
            max_=1550,
            range_text=["High", "Low"],
            is_calculable=False,
            range_color=['#22DDB8',"lightskyblue", "yellow", "red"],pos_top=50
        ),
    )

    .render("C:/a.html")
)

你可能感兴趣的:(#,Pyecharts)