diff --git a/src/main/resources/templates/populationinfo/list-bigdata.html b/src/main/resources/templates/populationinfo/list-bigdata.html index 6c0ab59..e72c6ad 100644 --- a/src/main/resources/templates/populationinfo/list-bigdata.html +++ b/src/main/resources/templates/populationinfo/list-bigdata.html @@ -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: {