echarts雷达图类目下显示值

let data = [
  {
    name: 'name1',
    max: 30
  },
  {
    name: 'name2',
    max: 30
  },
  {
    name: 'name3',
    max: 30
  },
  {
    name: 'name4',
    max: 30
  },
  {
    name: 'name5',
    max: 30
  },
  {
    name: 'name6',
    max: 30
  },
  {
    name: 'name7',
    max: 30
  }
];
let datavalue = [13, 25, 13, 24, 25, 14, 26];
let ii = -1;
option = {
  grid: {
    top: '5%',
    containLabel: true
  },
  animation: true, // 默认是true  是否开启动画
  animationDuration: 5000, // 动画时长 ms
  radar: {
    radius: '60%', //大小
    center: ['50%', '55%'], // 图的位置
    axisName: {
      rich: {
        a: {
          fontSize: '14',
          color: '#fff',
          align: 'left',
          lineHeight: '20'
        },
        b: {
          fontSize: '14',
          color: '#188BD9',
          align: 'left',
          fontWeight: 'bold'
        }
      },
      formatter: (a, b) => {
        ii++;
        // return `{a|${a}}\n{b|${datavalue[ii]}家}`;
        return `{a|${a}}    {b|${datavalue[ii]}家}`;
      }
    },
    axisLine: {
      lineStyle: {
        color: 'rgba(153, 209, 246, 0.2)'
      }
    },
    splitArea: {
      show: false,
      areaStyle: {
        color: 'rgba(255,0,0,0)' // 图表背景的颜色
      }
    },
    splitLine: {
      show: true,
      lineStyle: {
        width: 1,
        color: 'rgba(153, 209, 246, 0.3)' // 设置网格的颜色
      }
    },
    indicator: data
  },
  series: [
    {
      name: '示例',
      type: 'radar',
      data: [
        {
          value: datavalue,
          name: '示例',
          areaStyle: {
            color: 'rgba(153, 209, 246, 0.3)'
          },
          itemStyle: {
            normal: {
              borderWidth: 1,
              color: '#188BD9',
              borderColor: '#188BD9'
            }
          },
          lineStyle: {
            color: '#188BD9',
            width: 1
          },

          label: {
            show: false,
            color: '#188BD9',
            formatter: function (params) {
              return params.value + '家';
            }
          }
        }
      ]
    }
  ]
};

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值