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 d517d7e56e..8b55883384 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 @@ -101,6 +101,7 @@ onMounted(() => { :themes="themes" type="left" :chart-type="chart.type" + :layout="chart.customAttr.basicStyle.layout" @on-change-y-axis-form="changeAxisStyle" /> @@ -120,6 +121,7 @@ onMounted(() => { :themes="themes" type="right" :chart-type="chart.type" + :layout="chart.customAttr.basicStyle.layout" @on-change-y-axis-form="changeSubAxisStyle" /> 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 a950e0d2a3..c859c97e7e 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 @@ -14,6 +14,7 @@ const props = withDefaults( propertyInner?: Array type?: 'left' | 'right' chartType?: string + layout?: string }>(), { themes: 'dark', @@ -75,6 +76,14 @@ const init = () => { const showProperty = prop => props.propertyInner?.includes(prop) +const isBidirectionalBar = computed(() => { + return props.chartType === 'bidirectional-bar' +}) + +const isVerticalLayout = computed(() => { + return props.layout === 'vertical' +}) + onMounted(() => { init() }) @@ -99,9 +108,19 @@ onMounted(() => { size="small" @change="changeAxisStyle('position')" > -
- {{ t('chart.text_pos_top') }} - {{ t('chart.text_pos_bottom') }} +
+
+ {{ t('chart.text_pos_left') }} + {{ + t('chart.text_pos_right') + }} +
+
+ {{ t('chart.text_pos_top') }} + {{ + t('chart.text_pos_bottom') + }} +
{{ t('chart.text_pos_left') }} diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/XAxisSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/XAxisSelector.vue index bd357bd5e2..cc8b6151e2 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/XAxisSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/XAxisSelector.vue @@ -100,6 +100,14 @@ const init = () => { const showProperty = prop => props.propertyInner?.includes(prop) +const isBidirectionalBar = computed(() => { + return props.chart.type === 'bidirectional-bar' +}) + +const isHorizontalLayout = computed(() => { + return props.chart.customAttr.basicStyle.layout === 'horizontal' +}) + onMounted(() => { init() }) @@ -124,8 +132,10 @@ onMounted(() => { size="small" @change="changeAxisStyle('position')" > -
- {{ t('chart.text_pos_left') }} +
+ {{ + isHorizontalLayout ? t('chart.text_pos_left') : t('chart.text_pos_top') + }} {{ t('chart.text_pos_center') }} diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bidirectional-bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bidirectional-bar.ts index f5ce555ec9..9da46bd810 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bidirectional-bar.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bidirectional-bar.ts @@ -325,8 +325,9 @@ export class BidirectionalHorizontalBar extends G2PlotChartView< valueExt: undefined } } + const layoutHorizontal = options.layout === 'horizontal' // 处理横轴标题方向不对 - if (yAxis && yAxis['title']) { + if (yAxis && yAxis['title'] && layoutHorizontal) { yAxis['title'].autoRotate = false } const yAxisTmp = parseJson(chart.customStyle).yAxis