From 4814dc53d1133549674fedf108158045ef025c6d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 29 Sep 2022 17:18:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE):=20=E7=AC=A6=E5=8F=B7?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E6=B7=BB=E5=8A=A0=E6=95=B0=E5=AD=97=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=8F=90=E7=A4=BA=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/chart/util/ChartDataBuild.java | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java b/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java index d89a0192ae..0d6b4f7314 100644 --- a/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java +++ b/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java @@ -942,10 +942,30 @@ public class ChartDataBuild { public static Map transTableNormal(Map> fieldMap, ChartViewWithBLOBs view, List data, List desensitizationList) { List fields = new ArrayList<>(); + List yfields = new ArrayList<>(); if (CollectionUtils.isNotEmpty(fieldMap.get("xAxis"))) fields.addAll(fieldMap.get("xAxis")); - if (CollectionUtils.isNotEmpty(fieldMap.get("tooltipAxis"))) fields.addAll(fieldMap.get("tooltipAxis")); - if (CollectionUtils.isNotEmpty(fieldMap.get("labelAxis"))) fields.addAll(fieldMap.get("labelAxis")); + if (CollectionUtils.isNotEmpty(fieldMap.get("tooltipAxis"))) { + fieldMap.get("tooltipAxis").forEach(field -> { + Integer deType = field.getDeType(); + if(deType == 2 || deType == 3) { + yfields.add(field); + } else { + fields.add(field); + } + }); + } + if (CollectionUtils.isNotEmpty(fieldMap.get("labelAxis"))) { + fieldMap.get("labelAxis").forEach(field -> { + Integer deType = field.getDeType(); + if(deType == 2 || deType == 3) { + yfields.add(field); + } else { + fields.add(field); + } + }); + } if (CollectionUtils.isNotEmpty(fieldMap.get("yAxis"))) fields.addAll(fieldMap.get("yAxis")); + if (CollectionUtils.isNotEmpty(yfields)) fields.addAll(yfields); return transTableNormal(fields, view, data, desensitizationList); }