diff --git a/core/frontend/src/views/chart/chart/common/common_antv.js b/core/frontend/src/views/chart/chart/common/common_antv.js index 3e27c4a66e..5db67a2105 100644 --- a/core/frontend/src/views/chart/chart/common/common_antv.js +++ b/core/frontend/src/views/chart/chart/common/common_antv.js @@ -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) },