From baf6731375fda20c9719fe4bb37b822cb4ede470 Mon Sep 17 00:00:00 2001 From: ulleo Date: Tue, 20 Aug 2024 15:15:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BB=8E=E5=88=86=E7=BB=84=E6=9F=B1=E7=BA=BF=E5=9B=BE=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=A0=86=E5=8F=A0=E6=9F=B1=E7=BA=BF=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=9B=BE=E5=90=8E=EF=BC=8C=E5=A0=86=E5=8F=A0=E9=A1=B9=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E9=80=89=E9=A1=B9=E4=B8=8D=E6=AD=A3=E7=A1=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/manage/ChartDataManage.java | 5 +++++ .../js/panel/charts/others/chart-mix.ts | 21 +++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java b/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java index 9e2321cf94..9f42257fcf 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java +++ b/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java @@ -589,6 +589,11 @@ public class ChartDataManage { // get all fields List allFields = getAllChartFields(view); + // 针对分组切换堆叠时会遇到的问题 + if (StringUtils.equalsIgnoreCase(view.getType(), "bar-stack") || StringUtils.equalsIgnoreCase(view.getType(), "chart-mix-stack")) { + view.setXAxisExt(new ArrayList<>()); + } + List xAxisBase = new ArrayList<>(view.getXAxis()); List xAxis = new ArrayList<>(view.getXAxis()); List xAxisExt = new ArrayList<>(view.getXAxisExt()); diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/chart-mix.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/chart-mix.ts index a5ff2ac46b..5a6dbf75a8 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/chart-mix.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/chart-mix.ts @@ -45,7 +45,10 @@ export class ColumnLineMix extends G2PlotChartView { } axis: AxisType[] = [...CHART_MIX_AXIS_TYPE, 'xAxisExtRight', 'yAxisExt'] axisConfig = { - ...this['axisConfig'], + xAxis: { + name: `${t('chart.drag_block_type_axis')} / ${t('chart.dimension')}`, + type: 'd' + }, yAxis: { name: `${t('chart.drag_block_value_axis_left')} / ${t('chart.column_quota')}`, limit: 1, @@ -595,10 +598,10 @@ export class GroupColumnLineMix extends ColumnLineMix { } axisConfig = { ...this['axisConfig'], - yAxis: { - name: `${t('chart.drag_block_value_axis_left')} / ${t('chart.column_quota')}`, - limit: 1, - type: 'q' + xAxisExt: { + name: `${t('chart.chart_group')} / ${t('chart.dimension')}`, + type: 'd', + limit: 1 } } @@ -706,10 +709,10 @@ export class StackColumnLineMix extends ColumnLineMix { } axisConfig = { ...this['axisConfig'], - yAxis: { - name: `${t('chart.drag_block_value_axis_left')} / ${t('chart.column_quota')}`, - limit: 1, - type: 'q' + extStack: { + name: `${t('chart.stack_item')} / ${t('chart.dimension')}`, + type: 'd', + limit: 1 } }