fix: 区间条形图纵轴标签和轴线重合

#7528
This commit is contained in:
ulleo 2024-01-10 16:20:59 +08:00
parent 0671417748
commit 3a2a1135e0

View File

@ -711,13 +711,23 @@ export function getXAxis(chart) {
} }
} : null } : null
const position = transAxisPosition(chart, a)
if (a.axisLabel.show && chart.type === 'bidirectional-bar') { if (a.axisLabel.show && chart.type === 'bidirectional-bar') {
label.rotate = 0 label.rotate = 0
label.style.textAlign = 'start' label.style.textAlign = 'start'
} }
if (a.axisLabel.show && chart.type === 'bar-time-range') {
label.rotate = 0
if (position === 'top') {
label.style.textAlign = 'start'
} else {
label.style.textAlign = 'end'
}
}
axis = { axis = {
position: transAxisPosition(chart, a), position: position,
title: title, title: title,
grid: grid, grid: grid,
label: label, label: label,