From 1e660f3cd1e74f50bec18b337f5063222e439e20 Mon Sep 17 00:00:00 2001 From: zyh Date: Wed, 15 Nov 2023 17:48:36 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-3318=20fix=EF=BC=9Agauge=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/assets/css/components/chart/chart.scss | 4 ++-- nezha-fronted/src/components/chart/chart/chartGauge.vue | 4 ++-- .../src/components/chart/chart/options/chartGauge.js | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/nezha-fronted/src/assets/css/components/chart/chart.scss b/nezha-fronted/src/assets/css/components/chart/chart.scss index 4a4578d8f..99a264c60 100644 --- a/nezha-fronted/src/assets/css/components/chart/chart.scss +++ b/nezha-fronted/src/assets/css/components/chart/chart.scss @@ -626,8 +626,8 @@ text-overflow: ellipsis; white-space: nowrap; text-align: center; - position: relative; - bottom: 25%; + position: absolute; + bottom: 12%; } } .chart-svg { diff --git a/nezha-fronted/src/components/chart/chart/chartGauge.vue b/nezha-fronted/src/components/chart/chart/chartGauge.vue index 8c451e867..727db325e 100644 --- a/nezha-fronted/src/components/chart/chart/chartGauge.vue +++ b/nezha-fronted/src/components/chart/chart/chartGauge.vue @@ -210,7 +210,7 @@ export default { return Math.min(optimalSize, maxSize || optimalSize) }, calcGaugeSize (data) { - const dimension = Math.min(data.width, data.height) * 0.80 // radius + const dimension = Math.min(data.width, data.height) * 0.90 // radius const titleFontSize = Math.min((dimension * 0.15) / 1.2, 20) if (this.chartInfo.param.text === 'legend' || this.chartInfo.param.text === 'all') { @@ -248,7 +248,7 @@ export default { option.series[0].max = this.chartInfo.param.max || this.maxValue option.series[0].min = this.chartInfo.param.min || 0 - option.series[0].radius = '80%' + option.series[0].radius = '90%' const gaugeSize = this.calcGaugeSize(item) option.series[0].progress.width = gaugeSize.gaugeWidth option.series[0].axisLine.lineStyle.width = gaugeSize.gaugeWidth diff --git a/nezha-fronted/src/components/chart/chart/options/chartGauge.js b/nezha-fronted/src/components/chart/chart/options/chartGauge.js index 710c1e141..fabf463fb 100644 --- a/nezha-fronted/src/components/chart/chart/options/chartGauge.js +++ b/nezha-fronted/src/components/chart/chart/options/chartGauge.js @@ -35,7 +35,8 @@ const chartGaugeOption = { }, axisLine: { lineStyle: { - width: 30 + width: 30, + color: [[1, '#F4F5F5']] } }, axisTick: { @@ -53,7 +54,8 @@ const chartGaugeOption = { title: { show: false }, - data: [] + data: [], + center: ['50%', '60%'] } ] }