Merge pull request #12700 from dataease/pr@dev-v2@refactor_group_stack_bar_sum_label

refactor(图表): 分组堆叠柱状图去除总计标签
This commit is contained in:
wisonic-s
2024-10-14 19:32:29 +08:00
committed by GitHub

View File

@@ -436,10 +436,11 @@ export class GroupBar extends StackBar {
}
protected configLabel(chart: Chart, options: ColumnOptions): ColumnOptions {
const baseOptions = super.configLabel(chart, options)
if (!baseOptions.label) {
return baseOptions
const tmpLabel = getLabel(chart)
if (!tmpLabel) {
return options
}
const baseOptions = { ...options, label: tmpLabel }
const { label: labelAttr } = parseJson(chart.customAttr)
baseOptions.label.style.fill = labelAttr.color
const label = {
@@ -517,10 +518,11 @@ export class GroupStackBar extends StackBar {
}
protected configLabel(chart: Chart, options: ColumnOptions): ColumnOptions {
const baseOptions = super.configLabel(chart, options)
if (!baseOptions.label) {
return baseOptions
const tmpLabel = getLabel(chart)
if (!tmpLabel) {
return options
}
const baseOptions = { ...options, label: tmpLabel }
const { label: labelAttr } = parseJson(chart.customAttr)
baseOptions.label.style.fill = labelAttr.color
const label = {