fix(图表): 修复明细表自定义列宽铺满时宽度计算错误

This commit is contained in:
wisonic 2024-11-13 14:16:44 +08:00
parent 7e2625e03e
commit cb3de2fc76

View File

@ -489,7 +489,6 @@ export function getStyle(chart: Chart, dataConfig: S2DataConfig): Style {
: baseWidth * 10
const resultWidth = parseInt(tmpWidth.toFixed(0))
if (fullFilled) {
widthArr.push(resultWidth)
if (widthArr.length === dataConfig.meta.length - 1) {
const curTotalWidth = widthArr.reduce((p, n) => {
return p + n
@ -499,6 +498,7 @@ export function getStyle(chart: Chart, dataConfig: S2DataConfig): Style {
return restWidth
}
}
widthArr.push(resultWidth)
}
return resultWidth
}