diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/AssistLine.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/AssistLine.vue index a38848cb1d..4b56d35b37 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/AssistLine.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/AssistLine.vue @@ -212,6 +212,7 @@ onMounted(() => { class="dialog-css" > import icon_deleteTrash_outlined from '@/assets/svg/icon_delete-trash_outlined.svg' import icon_add_outlined from '@/assets/svg/icon_add_outlined.svg' -import { computed, onMounted, reactive } from 'vue' +import { computed, onMounted, PropType, reactive } from 'vue' import { useI18n } from '@/hooks/web/useI18n' import { COLOR_PANEL } from '@/views/chart/components/editor/util/chart' import { fieldType } from '@/utils/attr' @@ -11,6 +11,10 @@ import { iconFieldMap } from '@/components/icon-group/field-list' const { t } = useI18n() const props = defineProps({ + chart: { + type: Object as PropType, + required: true + }, line: { type: Array, required: true @@ -167,6 +171,13 @@ const getQuotaExtField = id => { } } +const getFieldOptions = computed(() => { + if (['percentage-bar-stack', 'percentage-bar-stack-horizontal'].includes(props.chart.type)) { + return state.fieldOptions.filter(item => item.value === '0') + } + return state.fieldOptions +}) + onMounted(() => { init() }) @@ -199,7 +210,7 @@ onMounted(() => { item !== 'assist-line') this.axis = [...BAR_AXIS_TYPE, 'extStack'] } } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/horizontal-bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/horizontal-bar.ts index 5320ff300c..721d3d2180 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/horizontal-bar.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/horizontal-bar.ts @@ -475,7 +475,8 @@ export class HorizontalPercentageStackBar extends HorizontalStackBar { this.configLegend, this.configXAxis, this.configYAxis, - this.configSlider + this.configSlider, + this.configAnalyseHorizontal )(chart, options, {}, this) } @@ -485,6 +486,5 @@ export class HorizontalPercentageStackBar extends HorizontalStackBar { ...this.baseOptions, isPercent: true } - this.properties = this.properties.filter(item => item !== 'assist-line') } }