From 27ac90b931a6b3a484fe45f9ddce1d0320aa8d36 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Thu, 7 Sep 2023 11:04:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A8=AA=E8=BD=B4=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=97=8B=E8=BD=AC=E8=A7=92=E5=BA=A6=E8=BE=83=E5=A4=A7=E6=97=B6?= =?UTF-8?q?=E5=92=8C=E5=9B=BE=E8=A1=A8=E9=87=8D=E5=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/views/chart/chart/common/common_antv.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) },