diff --git a/core/core-frontend/src/locales/en.ts b/core/core-frontend/src/locales/en.ts index 2fb67890f7..090f3c8408 100644 --- a/core/core-frontend/src/locales/en.ts +++ b/core/core-frontend/src/locales/en.ts @@ -1197,6 +1197,7 @@ export default { color_technology: 'Technology', color_simple: 'Simple', not_alpha: 'Opacity', + column_width_ratio: 'Column Width Ratio', area_border_color: 'Map border', area_base_color: 'Map area fill', size: 'Size', diff --git a/core/core-frontend/src/locales/tw.ts b/core/core-frontend/src/locales/tw.ts index d8bb9d5b8d..71293c6c48 100644 --- a/core/core-frontend/src/locales/tw.ts +++ b/core/core-frontend/src/locales/tw.ts @@ -1169,6 +1169,7 @@ export default { color_technology: '科技', color_simple: '簡潔', not_alpha: '不透明度', + column_width_ratio: '柱寬比例', area_border_color: '地圖邊線', area_base_color: '地圖區塊填充', size: '大小', diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 95ec8e90c2..f9377152bc 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -1171,6 +1171,7 @@ export default { color_technology: '科技', color_simple: '简洁', not_alpha: '不透明度', + column_width_ratio: '柱宽比例', area_border_color: '地图边线', area_base_color: '地图区块填充', size: '大小', 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 2c35194d0a..db806757be 100644 --- a/core/core-frontend/src/models/chart/chart-attr.d.ts +++ b/core/core-frontend/src/models/chart/chart-attr.d.ts @@ -177,6 +177,10 @@ declare interface ChartBasicStyle { * 圆角柱倒角 */ columnBarRightAngleRadius: number + /** + * 一般柱状图宽度占比,0 - 100 范围数值 + */ + columnWidthRatio: number /** * 柱间距 */ 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 ee061970ec..0385a910bf 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 @@ -65,6 +65,22 @@ const onAlphaChange = v => { changeBasicStyle('alpha') } +const onColumnWidthRatioChange = v => { + const _v = parseInt(v) + if (_v >= 1 && _v <= 100) { + state.basicStyleForm.columnWidthRatio = _v + } else if (_v < 1) { + state.basicStyleForm.columnWidthRatio = 1 + } else if (_v > 100) { + state.basicStyleForm.columnWidthRatio = 100 + } else { + const basicStyle = cloneDeep(props.chart.customAttr.basicStyle) + const oldForm = defaultsDeep(basicStyle, cloneDeep(DEFAULT_BASIC_STYLE)) as ChartBasicStyle + state.basicStyleForm.columnWidthRatio = oldForm.columnWidthRatio + } + changeBasicStyle('columnWidthRatio') +} + const changeMisc = prop => { emit('onMiscChange', { data: state.miscForm, requestData: true }, prop) } @@ -1207,6 +1223,40 @@ onMounted(() => { @change="changeBasicStyle('barGap')" /> +