style(图表): 优化明细表以及汇总表最后一列的排序方式会被遮挡的问题 #12063

This commit is contained in:
jianneng-fit2cloud 2024-09-26 18:52:58 +08:00
parent 0bc61f1b7d
commit 6461fbdeed
3 changed files with 15 additions and 0 deletions

View File

@ -195,6 +195,7 @@ export class TableInfo extends S2ChartView<TableSheet> {
}
} else {
// header interaction
chart.container = container
this.configHeaderInteraction(chart, s2Options)
}
// 开始渲染

View File

@ -166,6 +166,7 @@ export class TableNormal extends S2ChartView<TableSheet> {
}
} else {
// header interaction
chart.container = container
this.configHeaderInteraction(chart, s2Options)
}

View File

@ -901,6 +901,19 @@ export function configHeaderInteraction(chart: Chart, option: S2Options) {
event,
...props
})
const parent = document.getElementById(chart.container)
if (parent?.childNodes?.length) {
const child = Array.from(parent.childNodes)
.filter(node => node.nodeType === Node.ELEMENT_NODE)
.find(node => node.classList.contains('antv-s2-tooltip-container'))
if (child) {
const left = child.offsetLeft + child.clientWidth
if (left > parent.offsetWidth) {
const newLeft = parent.offsetWidth - child.clientWidth - 10
child.style.left = `${newLeft}px`
}
}
}
}
}
]