From e6f096ded323e801465bfb0fae056de5200fc57e Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 13 Apr 2022 11:54:03 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9char=20Stat=20?= =?UTF-8?q?=E6=9C=AA=E8=AE=BE=E7=BD=AE=E6=9C=80=E5=B0=8F=E5=AD=97=E5=8F=B7?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/chart/chart/chartStat.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nezha-fronted/src/components/chart/chart/chartStat.vue b/nezha-fronted/src/components/chart/chart/chartStat.vue index 69fa4d389..9f6f2fee8 100644 --- a/nezha-fronted/src/components/chart/chart/chartStat.vue +++ b/nezha-fronted/src/components/chart/chart/chartStat.vue @@ -11,7 +11,7 @@ background:item.mapping ? item.mapping.color.bac : (statData.length===1 ? '' : colorList[index]), height:item.height+'px', width:item.width + 'px', - fontSize: item.height > item.width ? (14 * (item.width/60)+ 'px') : (14 * (item.height/60)+ 'px') + fontSize: setFontSize(item) }" > @@ -211,6 +211,11 @@ export default { this.renderStat(layout) }) }, 50) + }, + setFontSize (item) { + let fontSize = item.height > item.width ? (14 * (item.width / 60)) : (14 * (item.height / 60)) + fontSize = fontSize > 12 ? fontSize : 8 + return fontSize + 'px' } }, mounted () {