function setEchartsPie(id, data) {
let $el = document.getElementById(id);
let myChart = this.echarts.init($el, '', {
width: 450,
height: 300,
});
let dataName = [];
let total = 0;
data.forEach((res) => {
dataName.push(res.name);
total += parseFloat(res.value) * 10000;
});
total = total / 10000;
let option = {
title: {
zlevel: 0,
text: [
'{value|¥' + total + '}',
'{name|总金额}',
].join('\n'),
rich: {
value: {
color: '#303133',
fontSize: 40,
fontWeight: 'bold',
lineHeight: 40,
},
name: {
color: '#909399',
lineHeight: 20<