echart 圆饼图 显示单位_echarts环形饼图中间显示总数
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( ),
rich: {
value: {
color: #303133,
fontSize: 40,
fontWeight: bold,
lineHeight: 40,
},
name: {
color: #909399,
lineHeight: 20
},
},
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( ), rich: { value: { color: #303133, fontSize: 40, fontWeight: bold, lineHeight: 40, }, name: { color: #909399, lineHeight: 20 }, },