Merge pull request #12027 from dataease/pr@dev-v2@chart-gauge-fix

fix(图表-仪表盘): 修复百分比刻度显示不正确的问题
This commit is contained in:
jianneng-fit2cloud 2024-09-04 19:32:23 +08:00 committed by GitHub
commit cffe216f89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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