fix(图表): 修复地图指标为 0 时标签不显示指标值 #14918

This commit is contained in:
wisonic
2025-03-04 17:52:20 +08:00
committed by wisonic-s
parent f39dd26056
commit 5cf8b85cf3
2 changed files with 5 additions and 3 deletions

View File

@@ -402,7 +402,8 @@ export class BubbleMap extends L7PlotChartView<ChoroplethOptions, Choropleth> {
content.push(name)
}
if (label.showQuota) {
areaMap[name] && content.push(valueFormatter(areaMap[name], label.quotaLabelFormatter))
;(areaMap[name] || areaMap[name] === 0) &&
content.push(valueFormatter(areaMap[name], label.quotaLabelFormatter))
}
item.properties['_DE_LABEL_'] = content.join('\n\n')
}

View File

@@ -301,7 +301,8 @@ export class Map extends L7PlotChartView<ChoroplethOptions, Choropleth> {
content.push(name)
}
if (label.showQuota) {
areaMap[name] && content.push(valueFormatter(areaMap[name], label.quotaLabelFormatter))
;(areaMap[name] || areaMap[name] === 0) &&
content.push(valueFormatter(areaMap[name], label.quotaLabelFormatter))
}
item.properties['_DE_LABEL_'] = content.join('\n\n')
}
@@ -508,7 +509,7 @@ export class Map extends L7PlotChartView<ChoroplethOptions, Choropleth> {
content.push(area.name)
}
if (label.showQuota) {
areaMap[area.name] &&
;(areaMap[area.name] || areaMap[area.name] === 0) &&
content.push(valueFormatter(areaMap[area.name].value, label.quotaLabelFormatter))
}
labelLocation.push({