diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 102d2f361b..790b625c86 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -1113,7 +1113,11 @@ export default { word_spacing: '文字间隔', table_layout_mode: '展示形式', table_layout_grid: '平铺展示', - table_layout_tree: '树形展示' + table_layout_tree: '树形展示', + top_n_desc: '合并数据', + top_n_input_1: '显示 Top', + top_n_input_2: ', 其余合并至其他', + top_n_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 2b0c398ff1..77065335b0 100644 --- a/core/core-frontend/src/models/chart/chart-attr.d.ts +++ b/core/core-frontend/src/models/chart/chart-attr.d.ts @@ -217,6 +217,18 @@ declare interface ChartBasicStyle { * 地图缩放按钮背景颜色 */ zoomBackground: string + /** + * 是否合并数据为其他 + */ + calcTopN: boolean + /** + * 只展示 TopN 项,其他合并为一项 + */ + topN: number + /** + * 其他项的标签 + */ + topNLabel: string } /** * 表头属性 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 6a0f1e6780..9e2d5548e5 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 @@ -5,7 +5,11 @@ import { useI18n } from '@/hooks/web/useI18n' import CustomColorStyleSelect from '@/views/chart/components/editor/editor-style/components/CustomColorStyleSelect.vue' import { cloneDeep, defaultsDeep } from 'lodash-es' import { SERIES_NUMBER_FIELD } from '@antv/s2' +import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' +import { storeToRefs } from 'pinia' +const dvMainStore = dvMainStoreWithOut() +const { batchOptStatus } = storeToRefs(dvMainStore) const { t } = useI18n() const props = defineProps({ chart: { @@ -466,6 +470,7 @@ onMounted(() => { { :min="0" :max="100" :effect="themes" + :disabled="batchOptStatus" @change="changeFieldColumnWidth()" > @@ -762,6 +768,46 @@ onMounted(() => { +
+ + + {{ $t('chart.top_n_desc') }} + + + + {{ $t('chart.top_n_input_1') }} + + {{ $t('chart.top_n_input_2') }} + + + + +