Skip to content

Commit c815f34

Browse files
committed
Merge remote-tracking branch 'origin/develop' into feat/support-clickInterval-for-dblclick
2 parents a56c13d + c03b347 commit c815f34

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "fix: tooltip should not render empty column when `hasShape` of tooltip is `false`, related to #3572\n\n",
5+
"type": "none",
6+
"packageName": "@visactor/vchart"
7+
}
8+
],
9+
"packageName": "@visactor/vchart",
10+
"email": "dingling112@gmail.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "fix: `othersLine` of tooltip can be hidden by `visible: false`, related to #3572\n\n",
5+
"type": "none",
6+
"packageName": "@visactor/vchart"
7+
}
8+
],
9+
"packageName": "@visactor/vchart",
10+
"email": "dingling112@gmail.com"
11+
}

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,11 @@ export class DomTooltipHandler extends BaseTooltipHandler {
246246
const colName = colDiv.getAttribute('data-col');
247247

248248
if (colName && columns.includes(colName)) {
249+
const hideColumn = colName === 'shape' && content.every(c => !c.hasShape || !c.shapeType);
250+
249251
setStyleToDom(colDiv, {
250252
...(this._domStyle as any)[colName],
251-
display: 'inline-block',
253+
display: hideColumn ? 'none' : 'inline-block',
252254
verticalAlign: 'top'
253255
});
254256
const rows = [...(colDiv.children as any)] as HTMLElement[];
@@ -266,8 +268,11 @@ export class DomTooltipHandler extends BaseTooltipHandler {
266268
row.classList.add(`${TOOLTIP_PREFIX}-${colName}`);
267269
colDiv.appendChild(row);
268270
}
271+
let styleByRow = index === content.length - 1 ? {} : { ...rowStyle };
272+
273+
styleByRow.display = entry.visible === false ? 'none' : 'block';
269274
// 每次更新,需要更新单元格的高度,防止同步高度的时候没有更新
270-
let styleByRow = index === content.length - 1 ? { height: 'initial' } : { ...rowStyle, height: 'initial' };
275+
styleByRow.height = 'initial';
271276

272277
if (colName === 'key') {
273278
row.innerHTML = formatContent(entry.key);

0 commit comments

Comments
 (0)