Skip to content

Commit e61b50a

Browse files
committed
fix: othersLine of tooltip can be hidden by visible: false, related to #3572
1 parent 287eb8a commit e61b50a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/vchart/src/plugin/components/tooltip-handler/dom-tooltip-handler.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,11 @@ export class DomTooltipHandler extends BaseTooltipHandler {
268268
row.classList.add(`${TOOLTIP_PREFIX}-${colName}`);
269269
colDiv.appendChild(row);
270270
}
271+
let styleByRow = index === content.length - 1 ? {} : { ...rowStyle };
272+
273+
styleByRow.display = entry.visible === false ? 'none' : 'block';
271274
// 每次更新,需要更新单元格的高度,防止同步高度的时候没有更新
272-
let styleByRow = index === content.length - 1 ? { height: 'initial' } : { ...rowStyle, height: 'initial' };
275+
styleByRow.height = 'initial';
273276

274277
if (colName === 'key') {
275278
row.innerHTML = formatContent(entry.key);
@@ -282,7 +285,6 @@ export class DomTooltipHandler extends BaseTooltipHandler {
282285
styleByRow = { ...styleByRow, ...getTextStyle(entry.valueStyle) };
283286
}
284287
} else if (colName === 'shape') {
285-
styleByRow.display = entry.hasShape ? 'inline-block' : 'none';
286288
row.innerHTML = getSvgHtml(entry);
287289
}
288290

0 commit comments

Comments
 (0)