Merge pull request #13794 from dataease/pr@dev-v2@fix_table_info__merge_cell

fix(图表): 修复明细表合并单元格计算错误 #13283
This commit is contained in:
wisonic-s 2024-12-03 22:49:39 +08:00 committed by GitHub
commit a7eaae3090
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1505,7 +1505,7 @@ export function configMergeCells(chart: Chart, options: S2Options, dataConfig: S
showText: j === textIndex showText: j === textIndex
}) })
} }
if (index === end) { if (index === end && lastVal === curVal) {
tmpMergeCells.push({ tmpMergeCells.push({
colIndex: showIndex ? i + 1 : i, colIndex: showIndex ? i + 1 : i,
rowIndex: index, rowIndex: index,
@ -1513,7 +1513,7 @@ export function configMergeCells(chart: Chart, options: S2Options, dataConfig: S
}) })
} }
mergedCellsInfo.push(tmpMergeCells) mergedCellsInfo.push(tmpMergeCells)
curMergedColInfo.push([lastIndex, index === end ? index : index - 1]) curMergedColInfo.push([lastIndex, index === end && lastVal === curVal ? index : index - 1])
} }
lastVal = curVal lastVal = curVal
lastIndex = index lastIndex = index