From 5f3169a889c45655d644c67c408389202ad9390d Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 24 Jun 2022 18:29:27 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-1952=20fix=EF=BC=9A=E5=9C=A8Group=E5=86=85?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9B=BE=E8=A1=A8=E5=90=8E=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E6=8B=96=E4=BD=8F=EF=BC=8C=E5=9B=BE=E8=A1=A8=E8=83=BD=E8=B6=85?= =?UTF-8?q?=E5=87=BA=E4=BB=A5=E5=88=9B=E5=BB=BA=E7=9A=84Group?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/chart/chart/grid/utils.js | 7 +++++-- nezha-fronted/src/components/chart/chartList.vue | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) 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) {