python数据可视化—绘制雷达图

import pyecharts.options as opts
from pyecharts.charts import Radar

v1 = [[290, 14641, 20, 17, 0.74, 3332,0.31]]
v2 = [[269, 14143, 26, 17, 0.64, 1250,0.32]]

(
    Radar(init_opts=opts.InitOpts(width="1280px", height="720px", bg_color="#EEE8CD"))
    .add_schema(
        schema=[
            opts.RadarIndicatorItem(name="场均补刀", max_=300),
            opts.RadarIndicatorItem(name="场均金钱", max_=16000),
            opts.RadarIndicatorItem(name="场均插眼", max_=30),
            opts.RadarIndicatorItem(name="场均排眼", max_=30),
            opts.RadarIndicatorItem(name="场均参团率", max_=1),
            opts.RadarIndicatorItem(name="场均对位经济差", max_=5000),
            opts.RadarIndicatorItem(name="伤害占比", max_=1),
        ],
        splitarea_opt=opts.SplitAreaOpts(
            is_show=True, areastyle_opts=opts.AreaStyleOpts(opacity=1)
        ),
        textstyle_opts=opts.TextStyleOpts(color="#8B8878"),
    )
    .add(
        series_name="Viper",
        data=v1,
        linestyle_opts=opts.LineStyleOpts(color="#FFF8DC"),
    )
    .add(
        series_name="Eric",
        data=v2,
        linestyle_opts=opts.LineStyleOpts(color="#CDC8B1"),
    )
    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))
    .set_global_opts(
        title_opts=opts.TitleOpts(title="ADC夏季赛数据雷达图"), legend_opts=opts.LegendOpts()
    )
    .render("data_radar_chart.html")
)

安装pyecharts包

pip install pyecharts
pip install pyecharts -i https://pypi.tuna.tsinghua.edu.cn/simple  #使用清华源安装

在这里插入图片描述

  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值