// 环形图的数据配置
setData() {
const getCardCount = this.cardData[1].num
let giveCardCount = this.cardData[0].num
if (getCardCount >= giveCardCount) giveCardCount = 0
this.myEcharts.setOption({
series: [
{
type: ‘pie‘,
radius: [‘35%‘, ‘45%‘],
hoverAnimation: false,
label: {
formatter: ‘{per|{d}%} ‘,
rich: {
per: {
color: ‘#FF7120‘,
backgroundColor: ‘rgba(0, 0, 0, 0)‘
}
}
},
data: [
{ value: getCardCount, name: ‘‘, itemStyle: { color: ‘#FF7120‘ } },
{ value: giveCardCount, name: ‘‘, label: { show: false }, labelLine: { show: false }, itemStyle: { opacity: 0 } }
]
}
]
})
}