fix(图表): 优化地图图例个数的计算

This commit is contained in:
jianneng-fit2cloud
2026-03-10 09:57:33 +08:00
committed by jianneng-fit2cloud
parent e08666b700
commit 80f9453731

View File

@@ -399,7 +399,7 @@ export class Map extends L7PlotChartView<ChoroplethOptions, Choropleth> {
} else {
// 数据较多,根据值范围平均分配,最多 9 个
// 计算每个区间的跨度
const idealIntervals = Math.min(9, Math.ceil(Math.sqrt(dataCount)))
const idealIntervals = Math.max(9, Math.ceil(Math.sqrt(dataCount)))
legendNumber = idealIntervals
}
// 确保图例数量在 1-9 之间