From 54e2f4f897bf3536dda054ca4e569de1b96b4b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=A1=E8=BE=99?= Date: Wed, 6 Mar 2019 14:05:15 +0800 Subject: [PATCH] fix: axis name align not working bug #9901 (#10051) --- src/component/axis/AxisBuilder.js | 6 +- test/axis-name.html | 134 ++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 test/axis-name.html diff --git a/src/component/axis/AxisBuilder.js b/src/component/axis/AxisBuilder.js index 9e66ea12e6..cf4a22b5b9 100644 --- a/src/component/axis/AxisBuilder.js +++ b/src/component/axis/AxisBuilder.js @@ -364,8 +364,10 @@ var builders = { textFont: textFont, textFill: textStyleModel.getTextColor() || axisModel.get('axisLine.lineStyle.color'), - textAlign: labelLayout.textAlign, - textVerticalAlign: labelLayout.textVerticalAlign + textAlign: textStyleModel.get('align') + || labelLayout.textAlign, + textVerticalAlign: textStyleModel.get('verticalAlign') + || labelLayout.textVerticalAlign }); if (axisModel.get('triggerEvent')) { diff --git a/test/axis-name.html b/test/axis-name.html new file mode 100644 index 0000000000..8dedbb9446 --- /dev/null +++ b/test/axis-name.html @@ -0,0 +1,134 @@ + + + + + + + + + + + + + +

nameLocation: end

+
+
+
+
+
+
+
+
+ +

nameLocation: middle

+
+
+
+
+
+
+
+
+ +

nameLocation: start

+
+
+
+
+
+
+
+
+ + + + \ No newline at end of file