Skip to content

Commit d68fc51

Browse files
committed
fix: fix the issue of setDimensionIndex
1 parent b510b35 commit d68fc51

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/vchart/src/chart/base/base-chart.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,14 @@ export class BaseChart<T extends IChartSpec> extends CompilableBase implements I
13951395
}
13961396
});
13971397
const isUnableValue =
1398-
isNil(value) || !dimensionInfo || dimensionInfo.every(d => isDiscrete(d.axis.getScale().type) && isNil(d.index));
1398+
// 如果是 nil 值 那么认为数据不可用
1399+
isNil(value) ||
1400+
// 如果没有 dimensionInfo 那么也认为数据不可用
1401+
!dimensionInfo ||
1402+
// 如果是离散轴,并且没有这一项,或者数据为空 那么也认为数据不可用
1403+
dimensionInfo.every(
1404+
d => isDiscrete(d.axis.getScale().type) && (isNil(d.index) || d.data.every(_data => _data.datum.length === 0))
1405+
);
13991406
// tooltip
14001407
if (opt.tooltip !== false) {
14011408
const tooltip = this.getComponentsByType(ComponentTypeEnum.tooltip)[0] as unknown as ITooltip;

0 commit comments

Comments
 (0)