diff --git a/core/core-frontend/src/custom-component/indicator/DeIndicator.vue b/core/core-frontend/src/custom-component/indicator/DeIndicator.vue index 53e3fa9c30..bb8c53aa9a 100644 --- a/core/core-frontend/src/custom-component/indicator/DeIndicator.vue +++ b/core/core-frontend/src/custom-component/indicator/DeIndicator.vue @@ -255,6 +255,7 @@ const showSuffix = ref(DEFAULT_INDICATOR_STYLE.suffixEnable) const suffixContent = ref('') const indicatorNameShow = ref(false) +const indicatorNamePositionBottom = ref(true) const indicatorNameWrapperStyle = reactive({ 'margin-top': DEFAULT_INDICATOR_NAME_STYLE.nameValueSpacing + 'px' @@ -369,8 +370,10 @@ const renderChart = async view => { } indicatorNameWrapperStyle['margin-top'] = (indicatorName.nameValueSpacing ?? DEFAULT_INDICATOR_NAME_STYLE.nameValueSpacing) + 'px' + indicatorNamePositionBottom.value = indicatorName.namePosition !== 'top' } else { indicatorNameShow.value = false + indicatorNamePositionBottom.value = false } } } @@ -595,11 +598,16 @@ defineExpose({ @trackClick="trackClick" :is-data-v-mobile="dataVMobile" /> +
+ {{ resultName }} +
+
{{ formattedResult }} {{ suffixContent }}
-
+
+
{{ resultName }}
diff --git a/core/core-frontend/src/locales/en.ts b/core/core-frontend/src/locales/en.ts index 62c7b2f92f..26760f9f72 100644 --- a/core/core-frontend/src/locales/en.ts +++ b/core/core-frontend/src/locales/en.ts @@ -1821,6 +1821,9 @@ export default { dimension_text_style: 'Name style', dimension_letter_space: 'Name letter spacing', name_value_spacing: 'Name/value spacing', + name_position: 'Position', + name_position_top: 'Top', + name_position_bottom: 'Bottom', font_family: 'Font', letter_space: 'Letter spacing', font_shadow: 'Font shadow', diff --git a/core/core-frontend/src/locales/tw.ts b/core/core-frontend/src/locales/tw.ts index 426959db27..0aab576065 100644 --- a/core/core-frontend/src/locales/tw.ts +++ b/core/core-frontend/src/locales/tw.ts @@ -1777,6 +1777,9 @@ export default { dimension_text_style: '名稱樣式', dimension_letter_space: '名稱字間距', name_value_spacing: '名稱/值間距', + name_position: '位置', + name_position_top: '上方', + name_position_bottom: '下方', font_family: '字體', letter_space: '字間距', font_shadow: '字體陰影', diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 752315cd5d..455901d995 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -1785,6 +1785,9 @@ export default { dimension_text_style: '名称样式', dimension_letter_space: '名称字间距', name_value_spacing: '名称/值间距', + name_position: '位置', + name_position_top: '上方', + name_position_bottom: '下方', font_family: '字体', letter_space: '字间距', font_shadow: '字体阴影', 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 52d924d7ee..ed1380f494 100644 --- a/core/core-frontend/src/models/chart/chart-attr.d.ts +++ b/core/core-frontend/src/models/chart/chart-attr.d.ts @@ -1301,6 +1301,10 @@ declare interface ChartIndicatorNameStyle { * 指标/名称间距 */ nameValueSpacing: number + /** + * 指标名称位置 + */ + namePosition?: 'top' | 'bottom' } /** diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorNameSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorNameSelector.vue index 4b84d16845..0d9d14df6c 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorNameSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorNameSelector.vue @@ -45,6 +45,11 @@ const fontFamily = CHART_FONT_FAMILY_ORIGIN.concat( ) const fontLetterSpace = CHART_FONT_LETTER_SPACE +const namePositionList = [ + { name: t('chart.name_position_top'), value: 'top' }, + { name: t('chart.name_position_bottom'), value: 'bottom' } +] + const state = reactive({ indicatorNameForm: JSON.parse(JSON.stringify(DEFAULT_INDICATOR_NAME_STYLE)), basicStyleForm: {} as ChartBasicStyle @@ -275,6 +280,27 @@ defineExpose({ getFormData }) @change="changeTitleStyle('nameValueSpacing')" /> + + + + + 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 0ec56b9219..f360749c69 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 @@ -548,7 +548,8 @@ export const DEFAULT_INDICATOR_NAME_STYLE: ChartIndicatorNameStyle = { fontFamily: 'Microsoft YaHei', letterSpace: 0, fontShadow: false, - nameValueSpacing: 0 + nameValueSpacing: 0, + namePosition: 'bottom' } export const DEFAULT_TITLE_STYLE_BASE: ChartTextStyle = {