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 9c987be935..bf788a7382 100644 --- a/core/core-frontend/src/models/chart/chart-attr.d.ts +++ b/core/core-frontend/src/models/chart/chart-attr.d.ts @@ -946,6 +946,10 @@ declare interface ChartLabelAttr { * 全部显示 */ fullDisplay: boolean + /** + * 仪表盘占比显示格式 + */ + proportionSeriesFormatter: SeriesFormatter } /** * 提示设置 diff --git a/core/core-frontend/src/utils/canvasStyle.ts b/core/core-frontend/src/utils/canvasStyle.ts index ee77b6366b..c675a33a26 100644 --- a/core/core-frontend/src/utils/canvasStyle.ts +++ b/core/core-frontend/src/utils/canvasStyle.ts @@ -127,7 +127,8 @@ export const customAttrTrans = { ], label: { fontSize: '', - seriesLabelFormatter: ['fontSize'] + seriesLabelFormatter: ['fontSize'], + proportionSeriesFormatter: ['fontSize'] }, tooltip: { fontSize: '', diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/LabelSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/LabelSelector.vue index efc953d811..c463944dd5 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/LabelSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/LabelSelector.vue @@ -238,7 +238,8 @@ const state = reactive<{ labelForm: DeepPartial }>({ seriesLabelFormatter: [], labelFormatter: DEFAULT_LABEL.labelFormatter, conversionTag: DEFAULT_LABEL.conversionTag, - totalFormatter: DEFAULT_LABEL.totalFormatter + totalFormatter: DEFAULT_LABEL.totalFormatter, + proportionSeriesFormatter: DEFAULT_LABEL.proportionSeriesFormatter } }) @@ -303,7 +304,10 @@ const showSeriesLabelFormatter = computed(() => { const showDivider = computed(() => { const DIVIDER_PROPS = ['labelFormatter', 'showDimension', 'showQuota', 'showProportion'] return ( - includesAny(props.propertyInner, ...DIVIDER_PROPS) && !isBarRangeTime.value && !isGroupBar.value + includesAny(props.propertyInner, ...DIVIDER_PROPS) && + !isBarRangeTime.value && + !isGroupBar.value && + !isGauge.value ) }) @@ -460,6 +464,9 @@ const conversionPrecision = [ const noFullDisplay = computed(() => { return !['liquid', 'gauge', 'indicator'].includes(props.chart.type) }) +const isGauge = computed(() => { + return props.chart.type === 'gauge' +})