From 41b78447fde6b32d42b3a963544ddb573cc0c33e Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 21 Jun 2023 16:17:19 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=20chartDiagram?= =?UTF-8?q?=20tooltip=20title=E5=AE=A3=E8=AA=93=E6=98=BE=E7=A4=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common/project/meta2d/js/meta2dMainCalc.js | 6 +++--- .../src/components/common/project/meta2d/meta2dTooltip.vue | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nezha-fronted/src/components/common/project/meta2d/js/meta2dMainCalc.js b/nezha-fronted/src/components/common/project/meta2d/js/meta2dMainCalc.js index b0db2552b..d98bb271b 100644 --- a/nezha-fronted/src/components/common/project/meta2d/js/meta2dMainCalc.js +++ b/nezha-fronted/src/components/common/project/meta2d/js/meta2dMainCalc.js @@ -361,12 +361,12 @@ export default { this.position.top = ePosition.layerY this.$nextTick(() => { if ((boxWidth / 2) > ePosition.layerX) { - this.position.left = ePosition.layerX + 20 + this.position.left = ePosition.layerX + 15 } else { - this.position.left = ePosition.layerX - 20 - 400 + this.position.left = ePosition.layerX - 15 - 400 } if (boxHeight / 2 > ePosition.layerY) { - this.position.top = ePosition.layerY + 50 + this.position.top = ePosition.layerY + 15 } else { this.position.top = ePosition.layerY - 300 } diff --git a/nezha-fronted/src/components/common/project/meta2d/meta2dTooltip.vue b/nezha-fronted/src/components/common/project/meta2d/meta2dTooltip.vue index c94cc89ee..795ba6acb 100644 --- a/nezha-fronted/src/components/common/project/meta2d/meta2dTooltip.vue +++ b/nezha-fronted/src/components/common/project/meta2d/meta2dTooltip.vue @@ -64,6 +64,9 @@ export default { console.log(this.params.title, this.dataSource.elements.expression, this.dataSource.metric) this.title = this.handleLegendAlias(this.params.title, this.params.title, this.dataSource.metric) || this.params.title this.content = this.handleLegendAlias(this.params.content, this.params.content, this.dataSource.metric) || this.params.content + } else { + this.title = this.params.title + this.content = this.params.content } this.params.legends.forEach(item => { const findItem = this.queryValues.find(query => query.name === item.legend && query.parent === item.parent)