Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Axis.nameTextStyle.width is not valid #16206

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/component/axis/AxisBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ const builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBu
text: name,
font: textFont,
overflow: 'truncate',
width: maxWidth,
width: maxWidth || +textStyleModel.get('width'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using || is not correct because maxWidth can be 0. You should update the logic at https://github.com/apache/echarts/pull/16206/files#diff-180b57aa9331c3128a2e4f577028b529d0318bf3eecc911499242546bf1012ceR425 in retrieve.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also test @weixingqi 's report. Thanks!

ellipsis,
fill: textStyleModel.getTextColor()
|| axisModel.get(['axisLine', 'lineStyle', 'color']) as ColorString,
Expand Down
Loading