You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2024/07/05 08:27:43 UTC
(echarts) branch fix/radar-name created (now 306a400d0)
This is an automated email from the ASF dual-hosted git repository.
wangzx pushed a change to branch fix/radar-name
in repository https://gitbox.apache.org/repos/asf/echarts.git
at 306a400d0 fix(radar): fix radar name overflow
This branch includes the following new commits:
new 306a400d0 fix(radar): fix radar name overflow
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
(echarts) 01/01: fix(radar): fix radar name overflow
Posted by wa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
wangzx pushed a commit to branch fix/radar-name
in repository https://gitbox.apache.org/repos/asf/echarts.git
commit 306a400d0987c53083b891eb351c77fbce4af26f
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Fri Jul 5 16:26:13 2024 +0800
fix(radar): fix radar name overflow
---
src/component/axis/AxisBuilder.ts | 7 +++++--
src/coord/radar/RadarModel.ts | 1 +
test/radar.html | 13 ++++++++++---
3 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/src/component/axis/AxisBuilder.ts b/src/component/axis/AxisBuilder.ts
index 1644d5024..c5a024ed8 100644
--- a/src/component/axis/AxisBuilder.ts
+++ b/src/component/axis/AxisBuilder.ts
@@ -425,7 +425,10 @@ const builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBu
const truncateOpt = axisModel.get('nameTruncate', true) || {};
const ellipsis = truncateOpt.ellipsis;
const maxWidth = retrieve(
- opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth
+ textStyleModel.get('width') as number,
+ opt.nameTruncateMaxWidth,
+ truncateOpt.maxWidth,
+ axisNameAvailableWidth
);
const textEl = new graphic.Text({
@@ -436,7 +439,7 @@ const builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBu
style: createTextStyle(textStyleModel, {
text: name,
font: textFont,
- overflow: 'truncate',
+ overflow: textStyleModel.get('overflow' as any) || 'truncate',
width: maxWidth,
ellipsis,
fill: textStyleModel.getTextColor()
diff --git a/src/coord/radar/RadarModel.ts b/src/coord/radar/RadarModel.ts
index e3728c110..c9b164894 100644
--- a/src/coord/radar/RadarModel.ts
+++ b/src/coord/radar/RadarModel.ts
@@ -146,6 +146,7 @@ class RadarModel extends ComponentModel<RadarOption> implements CoordinateSystem
nameGap: nameGap,
// min: 0,
nameTextStyle: iNameTextStyle,
+ nameRotate: nameTextStyle.rotate,
triggerEvent: triggerEvent
} as InnerIndicatorAxisOption, false);
if (zrUtil.isString(nameFormatter)) {
diff --git a/test/radar.html b/test/radar.html
index 64e4e31bf..8752bd0bb 100644
--- a/test/radar.html
+++ b/test/radar.html
@@ -53,9 +53,16 @@ under the License.
},
radar: {
radius: [50, '70%'],
- name: {
- formatter:'【{value}】',
- color:'#72ACD1'
+ axisName: {
+ formatter:'【{value}】11',
+ color:'#72ACD1',
+ width: 50,
+ textBorderColor: 'red',
+ textBorderWidth: 1,
+ textShadowColor: 'cyan',
+ textShadowBlur: 5,
+ ellipsis: 'aaa',
+ rotate: 50
},
triggerEvent: true,
// shape: 'circle',
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org