mirror of
https://github.com/pyecharts/pyecharts.git
synced 2026-01-25 17:06:27 +00:00
* ✨ globe in 3d * 💚 test map3d and map globe * 💄 update import list * 📚 add render examples * 💄 update coding style * Format: code
29 lines
710 B
Python
29 lines
710 B
Python
import pyecharts.options as opts
|
|
from example.commons import POPULATION
|
|
from pyecharts.charts import MapGlobe
|
|
|
|
high = max([x for _, x in POPULATION[1:]])
|
|
low = min([x for _, x in POPULATION[1:]])
|
|
|
|
m = (
|
|
MapGlobe()
|
|
.add_schema()
|
|
.add(
|
|
maptype="world",
|
|
series_name="World Population",
|
|
data_pair=POPULATION[1:],
|
|
is_map_symbol_show=False,
|
|
label_opts=opts.LabelOpts(is_show=False),
|
|
)
|
|
.set_global_opts(
|
|
visualmap_opts=opts.VisualMapOpts(
|
|
min_=low,
|
|
max_=high,
|
|
range_text=["max", "min"],
|
|
is_calculable=True,
|
|
range_color=["lightskyblue", "yellow", "orangered"],
|
|
)
|
|
)
|
|
)
|
|
m.render()
|