from pyecharts import options as opts
from pyecharts.charts import Radar
value_bj = [
[267, 216, 280, 4.8, 108, 64],
[185, 127, 216, 2.52, 61, 27],
]
value_sh = [
[250, 200, 260, 3.82, 80, 40],
[200, 150, 200, 4.86, 50, 29],
]
c_schema = [
{"name": "AQI", "max": 300, "min": 5},
{"name": "PM2.5", "max": 250, "min": 20},
{"name": "PM10", "max": 300, "min": 5},
{"name": "CO", "max": 5},
{"name": "NO2", "max": 200},
{"name": "SO2", "max": 100},
]
c = (
Radar()
.add_schema(schema=c_schema, shape="circle")
.add("北京", value_bj, color="#f9713c")
.add("上海", value_sh, color="#b3e4a1")
.set_series_opts(label_opts=opts.LabelOpts(is_show=False))
.set_global_opts(title_opts=opts.TitleOpts(title="Radar-空气质量"))
.render("radar_air_quality.html")
)
效果展示:
具体参数和方法详解:参见