<template>
  <div id="myChart" style="width:150px;height:150px;"></div>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      option: {
        tooltip: {
          trigger: 'item',
          formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        series: [
          {
            name: '疫情数据',
            type: 'pie',
            radius: '55%',
            center: ['40%', '50%'],
            labelLine: {
              show: false
            },
            data: [
              {value: 335, name: '武汉'},
              {value: 310, name: '北京'},
              {value: 234, name: '上海'}
            ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
            }
          }
        ]
      }
    }
  },
  methods: {
    drawChart() {
      let myChart = this.$echarts.init(document.getElementById('myChart'))
      myChart.setOption(this.option)
    }
  },
  mounted() {
    this.drawChart()
  }

}
</script>

<style scoped>

</style>
