mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 05:22:13 +08:00
fix(图表): 修复百分比条形图标签不显示 #17509
This commit is contained in:
@@ -628,14 +628,14 @@ export class HorizontalPercentageStackBar extends HorizontalStackBar {
|
||||
'tooltip-selector': ['color', 'fontSize', 'backgroundColor', 'show']
|
||||
}
|
||||
protected configLabel(chart: Chart, options: BarOptions): BarOptions {
|
||||
const baseOptions = super.configLabel(chart, options)
|
||||
if (!baseOptions.label) {
|
||||
return baseOptions
|
||||
const baseLabel = getLabel(chart)
|
||||
if (!baseLabel) {
|
||||
return { ...options, label: baseLabel }
|
||||
}
|
||||
const { customAttr } = chart
|
||||
const l = parseJson(customAttr).label
|
||||
const label = {
|
||||
...baseOptions.label,
|
||||
...baseLabel,
|
||||
formatter: function (data: Datum) {
|
||||
let value = data.value
|
||||
if (value) {
|
||||
@@ -662,7 +662,7 @@ export class HorizontalPercentageStackBar extends HorizontalStackBar {
|
||||
}
|
||||
}
|
||||
return {
|
||||
...baseOptions,
|
||||
...options,
|
||||
label
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user