diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/LegendSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/LegendSelector.vue index 6dd48f5423..cc50167c3c 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/LegendSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/LegendSelector.vue @@ -356,7 +356,6 @@ onMounted(() => { { { }, 'l7plot-legend__category-marker': { ...LEGEND_SHAPE_STYLE_MAP[legend.icon], - width: '8px', - height: '8px' + width: '9px', + height: '9px', + border: '0.01px solid #f4f4f4' } } } @@ -311,9 +312,15 @@ export class Map extends L7PlotChartView { ranges.forEach((range, index) => { const tmpRange = [range[0]?.toFixed(0), range[1]?.toFixed(0)] const colorIndex = index % colors.length + // 当区间第一个值小于最小值时,颜色取地图底色 + const isLessThanMin = range[0] < ranges[0][0] + let rangeColor = colors[colorIndex] + if (isLessThanMin) { + rangeColor = hexColorToRGBA(basicStyle.areaBaseColor, basicStyle.alpha) + } items.push({ value: tmpRange, - color: colors[colorIndex] + color: rangeColor }) }) customLegend['items'] = items @@ -332,6 +339,17 @@ export class Map extends L7PlotChartView { const c = findColorByValue(t.value, items) return c ? c : null } + customLegend['domStyles'] = { + ...customLegend['domStyles'], + 'l7plot-legend l7plot-legend__category': { + 'box-shadow': '0px 0px 0px 0px', + 'background-color': 'var(--bgColor)', + padding: 0 + }, + 'l7plot-legend__list-item': { + 'margin-bottom': '3px' + } + } } else { customLegend['customContent'] = (_: string, items: CategoryLegendListItem[]) => { const showItems = items?.length > 30 ? items.slice(0, 30) : items @@ -368,6 +386,11 @@ export class Map extends L7PlotChartView { return options } + setupDefaultOptions(chart: ChartObj): ChartObj { + chart.customAttr.basicStyle.areaBaseColor = '#f4f4f4' + return chart + } + protected setupOptions( chart: Chart, options: ChoroplethOptions, diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/tooltip-carousel.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/tooltip-carousel.ts index 656c361480..ae451b5940 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/tooltip-carousel.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/tooltip-carousel.ts @@ -12,7 +12,7 @@ export const configCarouselTooltip = (chart, view, data, scene) => { ?.filter(i => i.dimensionList?.length > 0) .reduce((acc, current) => { const existingItem = acc.find(obj => { - if (obj.abbrev === 'China') { + if (!obj.abbrev || obj.abbrev === 'China') { return obj.adcode === current.adcode } else { return obj.abbrev === current.abbrev