!152 fix: 柱状图传入错误数据后展示问题

Merge pull request !152 from szy/fix/barcommon
This commit is contained in:
奔跑的面条 2023-04-05 08:27:11 +00:00 committed by Gitee
commit 59b9ca0569

View File

@ -63,10 +63,13 @@ watch(
if (dimensionsGap < 0) {
props.chartConfig.option.series.splice(newDimensions - 1)
} else if (dimensionsGap > 0) {
if(!oldData || !oldData?.dimensions || !Array.isArray(oldData?.dimensions) || !oldData?.dimensions.length ) {
props.chartConfig.option.series=[]
}
for (let i = 0; i < dimensionsGap; i++) {
seriesArr.push(cloneDeep(seriesItem))
}
props.chartConfig.option.series = [...seriesArr]
props.chartConfig.option.series.push(...seriesArr)
}
replaceMergeArr.value = ['series']
nextTick(() => {