Merge pull request #11250 from dataease/pr@dev-v2@chart-bubble-tooltip-fix

fix(图表-气泡地图): 修复添加提示字段并设置空值处理置为0失败的问题
This commit is contained in:
jianneng-fit2cloud 2024-07-30 11:29:24 +08:00 committed by GitHub
commit b8cc3e7521
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,6 +61,10 @@ export abstract class L7PlotChartView<
if (emptyDataStrategy === 'setZero') {
data.forEach(item => {
item.value === null && (item.value = 0)
item.dynamicTooltipValue?.length > 0 &&
item.dynamicTooltipValue.forEach(ele => {
ele.value === null && (ele.value = 0)
})
})
}
if (emptyDataStrategy === 'ignoreData') {
@ -68,6 +72,11 @@ export abstract class L7PlotChartView<
if (data[i].value === null) {
data.splice(i, 1)
}
for (let j = data[i].dynamicTooltipValue?.length - 1; j >= 0; j--) {
if (data[i].dynamicTooltipValue[j].value === null) {
data[i].dynamicTooltipValue.splice(j, 1)
}
}
}
}
options.source.data = data