diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 13386a2ee9..ce23c85708 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -1541,7 +1541,8 @@ export default { map_symbol_octagon: '八角形', map_symbol_hexagram: '菱形', tip: '提示', - hide: '隐藏' + hide: '隐藏', + show_label: '显示标签' }, dataset: { scope_edit: '仅编辑时生效', diff --git a/core/core-frontend/src/models/chart/chart-attr.d.ts b/core/core-frontend/src/models/chart/chart-attr.d.ts index 746a28ddd6..68b4a12cb5 100644 --- a/core/core-frontend/src/models/chart/chart-attr.d.ts +++ b/core/core-frontend/src/models/chart/chart-attr.d.ts @@ -289,6 +289,10 @@ declare interface ChartBasicStyle { * 符号地图符号大小最大值 */ mapSymbolSizeMax: number + /** + * 显示标签 + */ + showLabel: boolean } /** * 表头属性 diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/BasicStyleSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/BasicStyleSelector.vue index 04fba8a550..c81edad34b 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/BasicStyleSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/BasicStyleSelector.vue @@ -603,12 +603,21 @@ onMounted(() => { + + + {{ t('chart.show_label') }} + + {{ t('chart.show_zoom') }} diff --git a/core/core-frontend/src/views/chart/components/editor/util/chart.ts b/core/core-frontend/src/views/chart/components/editor/util/chart.ts index 423c93ee27..55dcdc8d7d 100644 --- a/core/core-frontend/src/views/chart/components/editor/util/chart.ts +++ b/core/core-frontend/src/views/chart/components/editor/util/chart.ts @@ -1585,7 +1585,8 @@ export const DEFAULT_BASIC_STYLE: ChartBasicStyle = { seriesColor: [], layout: 'horizontal', mapSymbolSizeMin: 4, - mapSymbolSizeMax: 30 + mapSymbolSizeMax: 30, + showLabel: true } export const BASE_VIEW_CONFIG = { diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/flow-map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/flow-map.ts index 8f741e2aa1..e42d01bd0c 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/flow-map.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/flow-map.ts @@ -30,7 +30,7 @@ export class FlowMap extends L7ChartView { ] propertyInner: EditorPropertyInner = { ...MAP_EDITOR_PROPERTY_INNER, - 'basic-style-selector': ['mapBaseStyle', 'mapLineStyle', 'zoom'] + 'basic-style-selector': ['mapBaseStyle', 'mapLineStyle', 'zoom', 'showLabel'] } axis: AxisType[] = ['xAxis', 'xAxisExt', 'filter', 'flowMapStartName', 'flowMapEndName', 'yAxis'] axisConfig: AxisConfig = { @@ -84,7 +84,8 @@ export class FlowMap extends L7ChartView { token: key ?? undefined, style: mapStyle, pitch: misc.mapPitch, - zoom: 2.5 + zoom: 2.5, + showLabel: !(basicStyle.showLabel === false) }) }) mapRendering(container) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/heat-map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/heat-map.ts index 21fdf99bd4..dd7c50c7db 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/heat-map.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/heat-map.ts @@ -27,7 +27,7 @@ export class HeatMap extends L7ChartView { ] propertyInner: EditorPropertyInner = { ...MAP_EDITOR_PROPERTY_INNER, - 'basic-style-selector': ['colors', 'heatMapStyle', 'zoom'] + 'basic-style-selector': ['colors', 'heatMapStyle', 'zoom', 'showLabel'] } axis: AxisType[] = ['xAxis', 'yAxis', 'filter'] axisConfig: AxisConfig = { @@ -50,8 +50,8 @@ export class HeatMap extends L7ChartView { const { chart, container } = drawOption const xAxis = deepCopy(chart.xAxis) const yAxis = deepCopy(chart.yAxis) - let basicStyle - let miscStyle + let basicStyle: DeepPartial + let miscStyle: DeepPartial if (chart.customAttr) { basicStyle = parseJson(chart.customAttr).basicStyle miscStyle = parseJson(chart.customAttr).misc @@ -66,7 +66,8 @@ export class HeatMap extends L7ChartView { token: key ?? undefined, style: mapStyle, pitch: miscStyle.mapPitch, - zoom: 2.5 + zoom: 2.5, + showLabel: !(basicStyle.showLabel === false) }) }) mapRendering(container) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts index 8552c32efa..3a4b3bde03 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts @@ -30,7 +30,14 @@ export class SymbolicMap extends L7ChartView { ] propertyInner: EditorPropertyInner = { ...MAP_EDITOR_PROPERTY_INNER, - 'basic-style-selector': ['colors', 'alpha', 'mapBaseStyle', 'symbolicMapStyle', 'zoom'], + 'basic-style-selector': [ + 'colors', + 'alpha', + 'mapBaseStyle', + 'symbolicMapStyle', + 'zoom', + 'showLabel' + ], 'label-selector': ['color', 'fontSize', 'showFields', 'customContent'], 'tooltip-selector': [ 'color', @@ -89,7 +96,8 @@ export class SymbolicMap extends L7ChartView { style: mapStyle, pitch: miscStyle.mapPitch, center: [104.434765, 38.256735], - zoom: 1.8 + zoom: 2.5, + showLabel: !(basicStyle.showLabel === false) }) }) mapRendering(container) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/pie/pie.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/pie/pie.ts index 9dafb6c8fc..b68502ff4b 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/pie/pie.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/pie/pie.ts @@ -54,6 +54,7 @@ export class Pie extends G2PlotChartView { colorField: 'field', appendPadding: getPadding(chart), color, + animation: false, pieStyle: { lineWidth: 0 },