echarts-radar雷达图

在这里插入图片描述

<div id="radar-chart" style="width: 400px;"></div>
<script>
export default{
	data(){
		return {}
	},
	mounted(){
		this.init()
	},
	methods:{
		init () {
      	  const radarChart = this.$echarts.init(document.getElementById('radar-chart'), null, {renderer: 'svg'})
	      let option = {
	        radar: [{
	          center:['50%','50%'],
	          radius: '75%',
	          //图外名称
	          name: {
	            formatter: '{value}',
	            // 字体样式
	            textStyle: {
	              fontSize: 12,
	              color: '#888'
	            }
	          },
	          indicator: [
	            { name: "A", max: 10 ,axisLine:{lineStyle:{color:'#888'}}},
	            { name: "B", max: 10 ,axisLabel:{show:false},axisTick:{show:false}},
	            { name: "C", max: 10 ,axisLabel:{show:false},axisTick:{show:false}},
	            { name: "D", max: 10 ,axisLabel:{show:false},axisTick:{show:false}},
	            { name: "E", max: 10 ,axisLabel:{show:false},axisTick:{show:false}},
	            { name: "F", max: 10 ,axisLabel:{show:false},axisTick:{show:false}},
	            { name: "G", max: 10 ,axisLabel:{show:false},axisTick:{show:false}},
	            { name: "H", max: 10 ,axisLabel:{show:false},axisTick:{show:false}}
	          ],
	          nameGap: 12,
	          axisLine: { //米轴
	            show: true,
	            lineStyle: {
	              color: '#ccc',
	            },
	          },
	          axisTick:{
	            show:true,
	            length:3
	          },
	          splitNumber: 5, //轴的分割段数
	          axisLabel: { // 显示刻度值
	            show:true,
	            color:'#888',
	            fontSize:10,
	            margin:10
	          },
	          splitLine: {
	            lineStyle: {
	              color:"#e4e4e4"
	            }
	          },
	          splitArea: {
	            areaStyle: {
	              color: ['#fff'],  //雷达背景
	            }
	          }
	        }],
	        series: [{
	          name: "评估",
	          type: "radar",
	          data: [{
	            value: [7.7, 5, 6.6, 7.3, 6.7, 8, 5, 6.7],
	            name: "评估",
	            symbolSize:5,
	            itemStyle: { // 拐点
	              normal: {
	                borderColor: '#1890FF',
	                borderWidth: 1,
	                color: "#fff"
	              }
	            },
	            lineStyle:{  // 折线
	              color:'#1890FF',
	              width:1.5
	            },
	            areaStyle: { // 区域填充
	              normal: {
	                color: 'rgba(24,144,255,0.3)'
	              }
	            }
	          }],
	        }]
	      }
	      radarChart.clear();
	      setTimeout(()=>{radarChart.setOption(option)},100)
       }
	}
}
</script>

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值