Merge pull request #8913 from dataease/pr@dev@fix_gauge_min

fix(视图): AntV 仪表盘最小值不生效
This commit is contained in:
wisonic-s 2024-04-03 11:28:38 +08:00 committed by GitHub
commit fc2305120a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,7 +45,8 @@ export function baseGaugeOptionAntV(container, chart, action, scale = 1) {
if (gaugePercentLabel === false) {
const yAxis = parseJson(chart.yaxis)?.[0]
const formatter = yAxis?.formatterCfg ?? formatterItem
return valueFormatter(v * max, formatter)
const val = v === '0' ? min : v === '1' ? max : min + (max - min) * v
return valueFormatter(val, formatter)
}
return v === '0' ? v : (v * 100 + '%')
}