From c06b8eb879eb6725b93d0756b82e09c9e2beedab Mon Sep 17 00:00:00 2001 From: Map1en_ Date: Fri, 10 Dec 2021 18:14:10 +0800 Subject: [PATCH 1/3] fix: Axis.nameTextStyle.width is not valid --- src/component/axis/AxisBuilder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/component/axis/AxisBuilder.ts b/src/component/axis/AxisBuilder.ts index d06c0b5710..0a31142578 100644 --- a/src/component/axis/AxisBuilder.ts +++ b/src/component/axis/AxisBuilder.ts @@ -435,7 +435,7 @@ const builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBu text: name, font: textFont, overflow: 'truncate', - width: maxWidth, + width: maxWidth || Number(textStyleModel.get('width')) || undefined, ellipsis, fill: textStyleModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']) as ColorString, From c97f46d7d6e0ee398225a967dcb3e062d2a44a93 Mon Sep 17 00:00:00 2001 From: Map1en_ Date: Fri, 10 Dec 2021 21:48:21 +0800 Subject: [PATCH 2/3] make compact --- src/component/axis/AxisBuilder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/component/axis/AxisBuilder.ts b/src/component/axis/AxisBuilder.ts index 0a31142578..41deac8a0f 100644 --- a/src/component/axis/AxisBuilder.ts +++ b/src/component/axis/AxisBuilder.ts @@ -435,7 +435,7 @@ const builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBu text: name, font: textFont, overflow: 'truncate', - width: maxWidth || Number(textStyleModel.get('width')) || undefined, + width: maxWidth || +textStyleModel.get('width') || undefined, ellipsis, fill: textStyleModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']) as ColorString, From 3e2839a4c83f22d279d3856de69932a296e42d65 Mon Sep 17 00:00:00 2001 From: Map1en_ Date: Fri, 21 Jan 2022 15:45:10 +0800 Subject: [PATCH 3/3] rm undefined --- src/component/axis/AxisBuilder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/component/axis/AxisBuilder.ts b/src/component/axis/AxisBuilder.ts index 41deac8a0f..60591e9558 100644 --- a/src/component/axis/AxisBuilder.ts +++ b/src/component/axis/AxisBuilder.ts @@ -435,7 +435,7 @@ const builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBu text: name, font: textFont, overflow: 'truncate', - width: maxWidth || +textStyleModel.get('width') || undefined, + width: maxWidth || +textStyleModel.get('width'), ellipsis, fill: textStyleModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']) as ColorString,