diff --git a/nezha-fronted/src/components/chart/chart/grid/utils.js b/nezha-fronted/src/components/chart/chart/grid/utils.js index 2fa6c35df..732292e8e 100644 --- a/nezha-fronted/src/components/chart/chart/grid/utils.js +++ b/nezha-fronted/src/components/chart/chart/grid/utils.js @@ -291,8 +291,11 @@ export function moveElementAwayFromCollision (layout, collidesWith, itemToMove, // Previously this was optimized to move below the collision directly, but this can cause problems // with cascading moves, as an item may actually leapflog a collision and cause a reversal in order. - - return moveElement(layout, itemToMove, undefined, itemToMove.y + 0.15, preventCollision) + let addY = 0.15 + if (itemToMove.groupId) { + addY = 1 + } + return moveElement(layout, itemToMove, undefined, itemToMove.y + addY, preventCollision) } /** diff --git a/nezha-fronted/src/components/chart/chartList.vue b/nezha-fronted/src/components/chart/chartList.vue index 16735171d..7bb7097dd 100644 --- a/nezha-fronted/src/components/chart/chartList.vue +++ b/nezha-fronted/src/components/chart/chartList.vue @@ -479,6 +479,9 @@ export default { // } catch (e) { // console.info(e) // } + if (item.y < 0) { + item.y = 0 + } height = (item.type === 'group' && item.param.collapse) ? this.headerH : item.height // param.showHeader = true if (param.valueMapping) {