From 1f20486d2c8f530be463725b1bfbd9c7d2314cd7 Mon Sep 17 00:00:00 2001 From: "java_cuibaocheng@163.com" Date: Mon, 18 Dec 2023 16:20:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=8F=A3=E5=9F=BA=E6=9C=AC=E4=BF=A1?= =?UTF-8?q?=E6=81=AF-=20=E4=BF=AE=E6=94=B9=E4=BA=BA=E5=8F=A3=E9=A5=BC?= =?UTF-8?q?=E5=9B=BE=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/populationinfo/list-bigdata.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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: {