From 1f2005712bd088e4ec22a4fd4007f02d832f458e Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Wed, 21 Dec 2022 17:56:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE(=E6=8A=98=E7=BA=BF?= =?UTF-8?q?=E5=9B=BE)):=20=E4=BF=AE=E5=A4=8D=E6=8A=98=E7=BA=BF=E5=9B=BE?= =?UTF-8?q?=E6=9C=89=E5=AD=90=E7=BB=B4=E5=BA=A6=E6=97=B6=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes https://github.com/dataease/dataease/issues/4137 --- frontend/src/views/chart/chart/common/common_antv.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/chart/chart/common/common_antv.js b/frontend/src/views/chart/chart/common/common_antv.js index 32a1e2f091..c869d8132c 100644 --- a/frontend/src/views/chart/chart/common/common_antv.js +++ b/frontend/src/views/chart/chart/common/common_antv.js @@ -153,7 +153,7 @@ export function getLabel(chart) { // label value formatter if (chart.type && chart.type !== 'waterfall') { label.formatter = function(param) { - let yAxis, extStack + let yAxis, extStack, xaxisExt let res = param.value try { yAxis = JSON.parse(chart.yaxis) @@ -165,11 +165,16 @@ export function getLabel(chart) { } catch (e) { extStack = JSON.parse(JSON.stringify(chart.extStack)) } + try { + xaxisExt = JSON.parse(chart.xaxisExt) + } catch (e) { + xaxisExt = JSON.parse(JSON.stringify(chart.xaxisExt)) + } - if (equalsAny(chart.type, 'bar-stack', 'line-stack', + if (equalsAny(chart.type, 'line', 'bar-stack', 'line-stack', 'bar-stack-horizontal', 'percentage-bar-stack', 'percentage-bar-stack-horizontal')) { let f - if (extStack && extStack.length > 0) { + if (extStack?.length > 0 || xaxisExt?.length > 0) { f = yAxis[0] } else { for (let i = 0; i < yAxis.length; i++) {