vue echarts玫瑰类型视图

<style>
  @import "../../css/style.css";
</style>
<style scoped>
  @import "../../css/vue_rose_pie.css";
</style>
<template>
  <div class="pieRound">
    <div class="content">
      <chart class="pie" :options="pieRound" >
      </chart>
      <button class="btn" @click="toPie">环形按钮</button>
    </div>

  </div>
</template>
<script>

    export default {
        data() {
            return {}
        },
      created(){
      },
      methods:{
        toPie(){
        //路由跳转
          this.$router.push({path:'/half_pie'})
        }

      },
      computed:{
        pieRound(){
          return{
            legend: {
              show: false,
              orient: 'vertical',
              x: 'left',
              data: ['狮子', '大象'
                , '猩猩','老虎','豹子']
            },
            graphic: {
              elements: [{
                type: 'image',
                style: {
                  width: 20,
                  height: 20
                },
                left: 'center',
                top: 'center'
              }]
            },
            series: [{
              type: 'pie',
              radius: [20, '70%'],
              center: ['50%', '50%'],
              roseType: 'radius',
              color: ['#ADC4C3', '#6AA19E', '#476F6E', '#026E69', '#235957'  ],
              data: [{
                value: 20,
                name: '狮子'
              }, {
                value: 25,
                name: '豹子'
              }, {
                value: 30,
                name: '猩猩'
              }, {
                value: 23,
                name: '老虎'
              }, {
                value: 43,
                name: '大象'
              }],
              label: {

                normal: {
                  textStyle: {
                    fontSize: 14
                  },
                  formatter: function(param) {
                    return param.name + ':\n' + Math.round(param.percent) + '%';
                  }
                }
              },
              labelLine: {
                normal: {
                  smooth: true,
                  lineStyle: {
                    width: 2
                  }
                }
              },
              itemStyle: {
                //图形阴影
                normal: {
                  shadowBlur: 30,
                  shadowColor: 'rgba(0, 0, 0, 0.3)'
                }
              },

              animationType: 'scale',
              animationEasing: 'elasticOut',
              animationDelay: function(idx) {
                return Math.random() * 200;
              }
            }]

          }
        }
      }
    }

</script>

在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值