style(图表): 刻度值的数值格式,与指标的数值格式保持一致 #12339

This commit is contained in:
jianneng-fit2cloud 2024-11-25 14:54:27 +08:00
parent ae075a7089
commit 9cb3911daf

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 + '%'
}