Skip to content

Commit bedf25b

Browse files
committed
fix: fix the issue of setDimensionIndex
Revert "fix: fix the issue of setDimensionIndex" This reverts commit d68fc51. fix: fix the issue of setDimensionIndex
1 parent b510b35 commit bedf25b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1396,12 +1396,18 @@ export class BaseChart<T extends IChartSpec> extends CompilableBase implements I
13961396
});
13971397
const isUnableValue =
13981398
isNil(value) || !dimensionInfo || dimensionInfo.every(d => isDiscrete(d.axis.getScale().type) && isNil(d.index));
1399+
1400+
const isUnableTooltip =
1401+
// 如果数据本身不可用
1402+
isUnableValue ||
1403+
// 或者数据为空
1404+
dimensionInfo.every(d => isDiscrete(d.axis.getScale().type) && d.data.every(_data => _data.datum.length === 0));
13991405
// tooltip
14001406
if (opt.tooltip !== false) {
14011407
const tooltip = this.getComponentsByType(ComponentTypeEnum.tooltip)[0] as unknown as ITooltip;
14021408

14031409
if (tooltip?.getVisible()) {
1404-
if (isUnableValue) {
1410+
if (isUnableValue || isUnableTooltip) {
14051411
(<any>tooltip).hideTooltip?.();
14061412
} else {
14071413
const dataFilter: { [key: string]: any } = {};

0 commit comments

Comments
 (0)