From 7532cac10d1c67f6e2c57da880480d2b82dfc6e4 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Tue, 10 Mar 2026 21:50:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=9B=BE=E4=BE=8B=E6=95=B0=E9=87=8F=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E9=80=BB=E8=BE=91=E5=B9=B6=E4=BF=AE=E5=A4=8D=E7=A9=BA?= =?UTF-8?q?=E5=80=BC=E5=A4=84=E7=90=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chart/components/js/panel/charts/map/map.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts index 5bdf4674f8..4170d0e2dd 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts @@ -5,13 +5,13 @@ import { import type { Choropleth, ChoroplethOptions } from '@antv/l7plot/dist/esm/plots/choropleth' import { filterChartDataByRange, + filterEmptyMinValue, flow, getDynamicColorScale, getGeoJsonFile, - hexColorToRGBA, - parseJson, getMaxAndMinValueByData, - filterEmptyMinValue + hexColorToRGBA, + parseJson } from '@/views/chart/components/js/util' import { handleGeoJson, @@ -399,8 +399,7 @@ export class Map extends L7PlotChartView { } else { // 数据较多,根据值范围平均分配,最多 9 个 // 计算每个区间的跨度 - const idealIntervals = Math.max(9, Math.ceil(Math.sqrt(dataCount))) - legendNumber = idealIntervals + legendNumber = Math.max(9, Math.ceil(Math.sqrt(dataCount))) } // 确保图例数量在 1-9 之间 return Math.max(1, Math.min(9, legendNumber)) @@ -414,7 +413,7 @@ export class Map extends L7PlotChartView { let value = '-' if (item.value !== '') { if (Array.isArray(item.value)) { - const arr = item.value.every(Number.isNaN) ? item.color.value : item.value + const arr = item.value.every(Number.isNaN) ? item.color.value || [] : item.value value = arr .map(v => (Number.isNaN(v) || String(v) === 'NaN' ? 'NaN' : parseFloat(v).toFixed(0))) .join('-')