Skip to content

Commit

Permalink
Merge pull request #2752 from VisActor/2749-bug-stack-no-work-in-vtable
Browse files Browse the repository at this point in the history
2749 bug stack no work in vtable
  • Loading branch information
fangsmile authored Nov 7, 2024
2 parents 99146f7 + f540b35 commit 0711bc8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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"
}
8 changes: 4 additions & 4 deletions packages/vtable/src/layout/chart-helper/get-chart-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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 }

Expand Down

0 comments on commit 0711bc8

Please sign in to comment.