From b6ba0080a4b532b3e267e2d22127effb0398ba3d Mon Sep 17 00:00:00 2001 From: junjun Date: Wed, 31 Aug 2022 10:09:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E4=BB=85=E6=94=AF=E6=8C=81=E7=99=BE=E5=88=86=E6=AF=94?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/chart/gauge/gauge_antv.js | 7 +++---- .../views/chart/components/shape-attr/SizeSelectorAntV.vue | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/src/views/chart/chart/gauge/gauge_antv.js b/frontend/src/views/chart/chart/gauge/gauge_antv.js index 3d67f8f5cb..86473dab33 100644 --- a/frontend/src/views/chart/chart/gauge/gauge_antv.js +++ b/frontend/src/views/chart/chart/gauge/gauge_antv.js @@ -7,7 +7,7 @@ import { valueFormatter } from '@/views/chart/chart/formatter' let labelFormatter = null export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) { - let min, max, labelContent, startAngel, endAngel, tickCount + let min, max, labelContent, startAngel, endAngel // theme const theme = getTheme(chart) // data @@ -31,7 +31,6 @@ export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) { min = size.gaugeMin ? size.gaugeMin : DEFAULT_SIZE.gaugeMin max = size.gaugeMax ? size.gaugeMax : DEFAULT_SIZE.gaugeMax } - tickCount = size.gaugeTickCount ? size.gaugeTickCount : DEFAULT_SIZE.gaugeTickCount startAngel = parseInt(size.gaugeStartAngle) * Math.PI / 180 endAngel = parseInt(size.gaugeEndAngle) * Math.PI / 180 } @@ -101,13 +100,13 @@ export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) { content: labelContent }, axis: { - tickInterval: 1 / tickCount, + tickInterval: 0.2, label: { style: { fontSize: getScaleValue(14, scale) // 刻度值字体大小 }, formatter: function(v) { - return Number(v) * (max - min) + min + return v === '0' ? v : (v * 100 + '%') } }, tickLine: { diff --git a/frontend/src/views/chart/components/shape-attr/SizeSelectorAntV.vue b/frontend/src/views/chart/components/shape-attr/SizeSelectorAntV.vue index 9eacabd402..4d91ed5a9a 100644 --- a/frontend/src/views/chart/components/shape-attr/SizeSelectorAntV.vue +++ b/frontend/src/views/chart/components/shape-attr/SizeSelectorAntV.vue @@ -384,9 +384,9 @@ @change="changeBarSizeCase('gaugeEndAngle')" /> - - - + + +