From 04d71f139a0433f78f617c6f62ce0df40361d192 Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Mon, 4 Nov 2024 15:44:20 +0800 Subject: [PATCH 1/2] fix: parse axes config error when user set axes #2749 --- packages/vtable/src/layout/chart-helper/get-chart-spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/vtable/src/layout/chart-helper/get-chart-spec.ts b/packages/vtable/src/layout/chart-helper/get-chart-spec.ts index ba0249342..63ed58af6 100644 --- a/packages/vtable/src/layout/chart-helper/get-chart-spec.ts +++ b/packages/vtable/src/layout/chart-helper/get-chart-spec.ts @@ -170,7 +170,7 @@ export function getChartSpec(col: number, row: number, layout: PivotHeaderLayout export function getChartAxes(col: number, row: number, layout: PivotHeaderLayoutMap): any { const axes = []; if (layout.indicatorsAsCol) { - const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row); + const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row).slice(0, 2); // const colIndex = layout.getRecordIndexByCol(col); const colPath = layout.getColKeysPath(col, row); indicatorKeys.forEach((key, index) => { @@ -225,7 +225,7 @@ export function getChartAxes(col: number, row: number, layout: PivotHeaderLayout // label: { flush: true }, title: { visible: false }, domainLine: { visible: false }, - seriesIndex: index, + seriesIndex: axisOption?.seriesId ? undefined : index, // height: -1, sync: { axisId: NO_AXISID_FRO_VTABLE } // hack for fs @@ -273,7 +273,7 @@ export function getChartAxes(col: number, row: number, layout: PivotHeaderLayout ) ); } else { - const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row); + const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row).slice(0, 2); const rowPath = layout.getRowKeysPath(col, row); indicatorKeys.forEach((key, index) => { const { range, isZeroAlign, axisOption } = getRange( @@ -328,7 +328,7 @@ export function getChartAxes(col: number, row: number, layout: PivotHeaderLayout // label: { flush: true }, title: { visible: false }, domainLine: { visible: false }, - seriesIndex: index, + seriesIndex: axisOption?.seriesId ? undefined : index, // width: -1, // grid: index === 0 ? undefined : { visible: false } From f540b35f5fe1c044b0f27dbedac3ae7242def063 Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Mon, 4 Nov 2024 15:44:41 +0800 Subject: [PATCH 2/2] docs: update changlog of rush --- ...-bug-stack-no-work-in-vtable_2024-11-04-07-44.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/@visactor/vtable/2749-bug-stack-no-work-in-vtable_2024-11-04-07-44.json diff --git a/common/changes/@visactor/vtable/2749-bug-stack-no-work-in-vtable_2024-11-04-07-44.json b/common/changes/@visactor/vtable/2749-bug-stack-no-work-in-vtable_2024-11-04-07-44.json new file mode 100644 index 000000000..7779e0e43 --- /dev/null +++ b/common/changes/@visactor/vtable/2749-bug-stack-no-work-in-vtable_2024-11-04-07-44.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: parse axes config error when user set axes #2749\n\n", + "type": "none", + "packageName": "@visactor/vtable" + } + ], + "packageName": "@visactor/vtable", + "email": "892739385@qq.com" +} \ No newline at end of file