人口基本信息- 修改人口饼图的显示
This commit is contained in:
parent
8b265e88b0
commit
1f20486d2c
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user