From a5f72d69e7ca116c4e8c4eaa7cdf455a835eecb0 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 9 Jun 2023 14:03:16 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-2865=20=20fix=EF=BC=9Achart-Group=20?= =?UTF-8?q?=E5=86=85=E9=83=A8chart=E7=A7=BB=E5=8A=A8=E6=97=B6=20chart-Grou?= =?UTF-8?q?p=E9=AB=98=E5=BA=A6=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF=20?= =?UTF-8?q?=E5=AF=BC=E8=87=B4dashboard=E9=94=99=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/chart/chart/tools.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/nezha-fronted/src/components/chart/chart/tools.js b/nezha-fronted/src/components/chart/chart/tools.js index d91b5baf0..4c5d8a9c6 100644 --- a/nezha-fronted/src/components/chart/chart/tools.js +++ b/nezha-fronted/src/components/chart/chart/tools.js @@ -129,25 +129,19 @@ export function isTopology (type) { export function getGroupHeight (arr) { if (arr.length) { let lastItem = [] - let maxY = arr[0].y + let maxY = arr[0].y + arr[0].height arr.forEach((children, index) => { - if (maxY == children.y) { + if (maxY == (children.y + children.height)) { lastItem.push(children) - } else if (maxY < children.y) { - maxY = children.y + } else if (maxY < (children.y + children.height)) { + maxY = children.y + children.height lastItem = [children] } }) - let maxHeight = 0 - lastItem.forEach(last => { - if (maxHeight < last.height) { - maxHeight = last.height - } - }) if (maxY < 0) { maxY = 0 } - return maxHeight + maxY + return maxY } else { return 1 }