fix: 横轴标签旋转角度较大时和图表重叠

This commit is contained in:
wisonic-s 2023-09-07 11:04:04 +08:00
parent cde0419330
commit 27ac90b931

View File

@ -593,9 +593,11 @@ export function getXAxis(chart) {
stroke: axisCfg.lineStyle.color
}
} : null
const rotate = parseInt(a.axisLabel.rotate)
const label = a.axisLabel.show ? {
rotate: parseInt(a.axisLabel.rotate) * Math.PI / 180,
rotate: rotate * Math.PI / 180,
style: {
textAlign: rotate > 20 ? 'start' : rotate < -20 ? 'end' : 'center',
fill: a.axisLabel.color,
fontSize: parseInt(a.axisLabel.fontSize)
},