Merge pull request #13529 from dataease/pr@dev-v2@chart-gauge-style

style(图表): 仪表盘的刻度值的数值格式,与指标的数值格式保持一致 #12339
This commit is contained in:
jianneng-fit2cloud 2024-11-25 14:56:21 +08:00 committed by GitHub
commit 5f828f2093
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -276,7 +276,10 @@ export class Gauge extends G2PlotChartView<GaugeOptions, G2Gauge> {
return ''
}
if (gaugePercentLabel === false) {
return v === '0' ? min : v === '1' ? max : min + (max - min) * v
const resultV = v === '0' ? min : v === '1' ? max : min + (max - min) * v
return labelFormatter.type === 'value'
? valueFormatter(resultV, labelFormatter)
: resultV
}
return v === '0' ? v : v * 100 + '%'
}