Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 657 Bytes

bmap_heatmap.md

File metadata and controls

26 lines (21 loc) · 657 Bytes

pyecharts 代码 / 效果

from pyecharts import options as opts
from pyecharts.charts import BMap
from pyecharts.faker import Faker

c = (
    BMap()
    .add_schema(baidu_ak="FAKE_AK", center=[120.13066322374, 30.240018034923])
    .add(
        "bmap",
        [list(z) for z in zip(Faker.provinces, Faker.values())],
        type_="heatmap",
        label_opts=opts.LabelOpts(formatter="{b}"),
    )
    .set_global_opts(
        title_opts=opts.TitleOpts(title="BMap-热力图"), visualmap_opts=opts.VisualMapOpts()
    )
    .render("bmap_heatmap.html")
)
<iframe width="100%" height="800px" src="BMap/bmap_heatmap.html"></iframe>