From 3cbbb80873e3adec234dc2bf55f7c150c02aadc6 Mon Sep 17 00:00:00 2001 From: 04cb <0x04cb@gmail.com> Date: Sun, 8 Mar 2026 14:34:31 +0800 Subject: [PATCH] Fix axisLabel.height not taking effect without backgroundColor The height property was being set on text style but had no visual effect without a backgroundColor because zrender only uses height for background box rendering. Fix: Enable box properties processing when height is explicitly set, so that zrender can properly render the box with the specified height. --- src/label/labelStyle.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/label/labelStyle.ts b/src/label/labelStyle.ts index 7d294232d2..cd613fa6de 100644 --- a/src/label/labelStyle.ts +++ b/src/label/labelStyle.ts @@ -651,7 +651,9 @@ function setTokenTextStyle( textStyle.verticalAlign = baseline; } } - if (!isBlock || !opt.disableBox) { + // Enable box when height is explicitly set, so height property can take effect + const hasExplicitHeight = textStyleModel.getShallow('height') != null; + if (!isBlock || !opt.disableBox || hasExplicitHeight) { for (let i = 0; i < TEXT_PROPS_BOX.length; i++) { const key = TEXT_PROPS_BOX[i]; const val = textStyleModel.getShallow(key);