forked from github/dataease
style(图表): 优化明细表以及汇总表最后一列的排序方式会被遮挡的问题 #12063
This commit is contained in:
parent
0bc61f1b7d
commit
6461fbdeed
@ -195,6 +195,7 @@ export class TableInfo extends S2ChartView<TableSheet> {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// header interaction
|
// header interaction
|
||||||
|
chart.container = container
|
||||||
this.configHeaderInteraction(chart, s2Options)
|
this.configHeaderInteraction(chart, s2Options)
|
||||||
}
|
}
|
||||||
// 开始渲染
|
// 开始渲染
|
||||||
|
@ -166,6 +166,7 @@ export class TableNormal extends S2ChartView<TableSheet> {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// header interaction
|
// header interaction
|
||||||
|
chart.container = container
|
||||||
this.configHeaderInteraction(chart, s2Options)
|
this.configHeaderInteraction(chart, s2Options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -901,6 +901,19 @@ export function configHeaderInteraction(chart: Chart, option: S2Options) {
|
|||||||
event,
|
event,
|
||||||
...props
|
...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`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user