人口基本信息- 修改人口饼图的显示

This commit is contained in:
java_cuibaocheng@163.com 2023-12-18 16:20:21 +08:00
parent 8b265e88b0
commit 1f20486d2c

View File

@ -736,7 +736,7 @@
series[i].pieData.endRatio = endValue / sumValue;
series[i].parametricEquation = getParametricEquation(series[i].pieData.startRatio, series[i].pieData.endRatio);
startValue = endValue;
legendData.push(series[i].name);
legendData.push({name: series[i].pieData.name, value: series[i].pieData.value});
}
let option = {
legend: {
@ -745,6 +745,13 @@
data: legendData,
textStyle: {
color: "#FFF"
},
formatter: function(params) {
for (var i = 0 ; i < legendData.length ; i++) {
if(legendData[i].name == params) {
return legendData[i].name + ': 占比 ' + (legendData[i].value / startValue * 100).toFixed(2) + '%';
}
}
}
},
tooltip: {