From c57922992d289d44338ddbc5f67157572e062f41 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Mon, 8 Feb 2021 15:12:47 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E9=A5=BC?= =?UTF-8?q?=E5=9B=BE=E5=8D=95=E4=BD=8D=E6=B2=A1=E7=94=9F=E6=95=88=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20=EF=BC=8C=E4=BB=A5=E5=8F=8A=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E9=A1=B5=E9=9D=A2=E8=B7=9F=E9=A5=BC=E5=9B=BE=E4=BF=9D?= =?UTF-8?q?=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/charts/chart-pie.vue | 3 ++- .../src/components/charts/chartPreview.vue | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-pie.vue b/nezha-fronted/src/components/charts/chart-pie.vue index 652bfdd96..944bc0bd8 100644 --- a/nezha-fronted/src/components/charts/chart-pie.vue +++ b/nezha-fronted/src/components/charts/chart-pie.vue @@ -595,13 +595,14 @@ export default { } }, formatterFunc:function(params, ticket, callback){ + let chartInfo=this.chartData; return `
${this.legend[params.dataIndex].alias}
value
-
${params.value}
+
${chartDataFormat.getUnit(chartInfo.unit?chartInfo.unit:2).compute(params.value,null,-1,2)}
percent
diff --git a/nezha-fronted/src/components/charts/chartPreview.vue b/nezha-fronted/src/components/charts/chartPreview.vue index 7312c7333..be1d4ad56 100644 --- a/nezha-fronted/src/components/charts/chartPreview.vue +++ b/nezha-fronted/src/components/charts/chartPreview.vue @@ -419,12 +419,16 @@ if(chartItem.type ==='pie'){ pieSeries={ type: 'pie', - radius: ['20%', '100%'], + radius: '100%', center: ['50%', '50%'], - roseType: 'radius', + top:"20%", + bottom:"20%", + // roseType: 'radius', minAngle:10, itemStyle: { - borderRadius: 5 + borderRadius: 5, + borderColor: '#fff', + borderWidth: 1 }, label: { show: false @@ -1543,15 +1547,16 @@ } }, pieFormatterFunc:function(params, ticket, callback){ + let chartInfo=this.chart; return `
-
-
${this.legend[params.dataIndex].alias}
-
+
+
${this.legend[params.dataIndex].alias}
+
value
-
${params.value}
+
${chartDataFormat.getUnit(chartInfo.unit?chartInfo.unit:2).compute(params.value,null,-1,2)}
-
+
percent
${params.percent}%