From 151e3aef43a53f9310f52fc5a583adc472db6dc4 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Mon, 3 Jun 2024 18:02:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=A4=9A=E7=B3=BB=E5=88=97=E6=A0=87=E7=AD=BE=E5=92=8C=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E5=AD=97=E4=BD=93=E5=A4=A7=E5=B0=8F=E6=9C=AA=E9=80=82?= =?UTF-8?q?=E5=BA=94=E7=BC=A9=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/utils/canvasStyle.ts | 30 ++++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/core/core-frontend/src/utils/canvasStyle.ts b/core/core-frontend/src/utils/canvasStyle.ts index 7b5b7b0896..92942dbf59 100644 --- a/core/core-frontend/src/utils/canvasStyle.ts +++ b/core/core-frontend/src/utils/canvasStyle.ts @@ -125,8 +125,14 @@ export const customAttrTrans = { 'wordSizeRange', 'wordSpacing' ], - label: ['fontSize'], - tooltip: ['fontSize'], + label: { + fontSize: '', + seriesLabelFormatter: ['fontSize'] + }, + tooltip: { + fontSize: '', + seriesTooltipFormatter: ['fontSize'] + }, indicator: ['fontSize', 'suffixFontSize'], indicatorName: ['fontSize', 'nameValueSpacing'] } @@ -296,15 +302,25 @@ export function recursionTransObj(template, infoObj, scale, terminal) { // 如果是数组 进行赋值计算 if (template[templateKey] instanceof Array) { template[templateKey].forEach(templateProp => { - if (infoObj[templateKey] && infoObj[templateKey][templateProp]) { + if ( + infoObj[templateKey] && + (infoObj[templateKey][templateProp] || infoObj[templateKey].length) + ) { // 移动端特殊属性值设置 if (terminal === 'mobile' && mobileSpecialProps[templateProp] !== undefined) { infoObj[templateKey][templateProp] = mobileSpecialProps[templateProp] } else { - infoObj[templateKey][templateProp] = getScaleValue( - infoObj[templateKey][templateProp], - scale - ) + // 数组依次设置 + if (infoObj[templateKey] instanceof Array) { + infoObj[templateKey].forEach(v => { + v[templateProp] = getScaleValue(v[templateProp], scale) + }) + } else { + infoObj[templateKey][templateProp] = getScaleValue( + infoObj[templateKey][templateProp], + scale + ) + } } } })