From f61ca130fd7e4195ccb987d8f23722965d60d21f Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Fri, 22 Aug 2025 17:56:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=9B=BE=E6=94=AF=E6=8C=81=E6=8E=A7=E5=88=B6=E7=BA=B5=E8=BD=B4?= =?UTF-8?q?=E5=88=BB=E5=BA=A6=E6=98=BE=E9=9A=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/locales/en.ts | 1 + core/core-frontend/src/locales/tw.ts | 1 + core/core-frontend/src/locales/zh-CN.ts | 1 + .../core-frontend/src/models/chart/chart-style.d.ts | 4 ++++ .../editor-style/components/DualYAxisSelector.vue | 10 +++++----- .../components/DualYAxisSelectorInner.vue | 11 +++++++++++ .../src/views/chart/components/editor/util/chart.ts | 13 +++++++++---- .../chart/components/js/panel/types/impl/g2.ts | 1 + 8 files changed, 33 insertions(+), 9 deletions(-) diff --git a/core/core-frontend/src/locales/en.ts b/core/core-frontend/src/locales/en.ts index f16bfbd18b..1dc822a3f3 100644 --- a/core/core-frontend/src/locales/en.ts +++ b/core/core-frontend/src/locales/en.ts @@ -1491,6 +1491,7 @@ export default { axis_label_show: 'Label display', axis_label_color: 'Label color', axis_label_fontsize: 'Label size', + axis_tick_show: 'Show tick', text_style: 'Font style', bolder: 'Bold', change_ds: 'Change Dataset', diff --git a/core/core-frontend/src/locales/tw.ts b/core/core-frontend/src/locales/tw.ts index 8673f76db8..31b41ac71b 100644 --- a/core/core-frontend/src/locales/tw.ts +++ b/core/core-frontend/src/locales/tw.ts @@ -1450,6 +1450,7 @@ export default { axis_type_dashed: '虛線', axis_type_dotted: '點', axis_label_show: '標籤顯示', + axis_tick_show: '刻度顯示', axis_label_color: '標籤顏色', axis_label_fontsize: '標籤大小', text_style: '字體樣式', diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index adb85dda5a..699e21c080 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -1455,6 +1455,7 @@ export default { axis_type_dashed: '虚线', axis_type_dotted: '点', axis_label_show: '标签显示', + axis_tick_show: '刻度显示', axis_label_color: '标签颜色', axis_label_fontsize: '标签大小', text_style: '字体样式', diff --git a/core/core-frontend/src/models/chart/chart-style.d.ts b/core/core-frontend/src/models/chart/chart-style.d.ts index b84823319e..42a53d5b93 100644 --- a/core/core-frontend/src/models/chart/chart-style.d.ts +++ b/core/core-frontend/src/models/chart/chart-style.d.ts @@ -217,6 +217,10 @@ declare interface AxisLabel { * 长度限制 */ lengthLimit: number + /** + * 刻度显示 + */ + showTick: boolean } /** * 轴线条设置 diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelector.vue index f076986c90..17c270ba3c 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelector.vue @@ -5,7 +5,7 @@ import { DEFAULT_YAXIS_EXT_STYLE, DEFAULT_YAXIS_STYLE } from '@/views/chart/components/editor/util/chart' -import { cloneDeep } from 'lodash-es' +import { cloneDeep, defaultsDeep } from 'lodash-es' import DualYAxisSelectorInner from './DualYAxisSelectorInner.vue' const { t } = useI18n() @@ -59,15 +59,15 @@ const init = () => { customStyle = JSON.parse(chart.customStyle) } if (customStyle.yAxis) { - state.axisForm = cloneDeep(customStyle.yAxis) + state.axisForm = defaultsDeep(cloneDeep(customStyle.yAxis), DEFAULT_YAXIS_STYLE) state.axisForm.position = 'left' } if (customStyle.yAxisExt) { - state.subAxisForm = cloneDeep(customStyle.yAxisExt) + state.subAxisForm = defaultsDeep(cloneDeep(customStyle.yAxisExt), DEFAULT_YAXIS_EXT_STYLE) + state.subAxisForm.position = 'right' + state.subAxisForm.show = state.axisForm.show } - state.subAxisForm.position = 'right' - state.subAxisForm.show = state.axisForm.show if (chart.type === 'bidirectional-bar') { state.axisForm.position = customStyle.yAxis.position state.subAxisForm.position = customStyle.yAxisExt.position diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelectorInner.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelectorInner.vue index 798e72bb44..fdfae8fc31 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelectorInner.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelectorInner.vue @@ -434,6 +434,17 @@ onMounted(() => {
+ + + {{ t('chart.axis_tick_show') }} + +