You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "100pah (via GitHub)" <gi...@apache.org> on 2025/06/23 09:08:44 UTC
Re: [PR] fix(legend): Fix legend text overflow and improve layout handling [echarts]
100pah commented on code in PR #20967:
URL: https://github.com/apache/echarts/pull/20967#discussion_r2161105712
##########
src/component/legend/LegendView.ts:
##########
@@ -469,7 +473,8 @@ class LegendView extends ComponentView {
y: itemHeight / 2,
fill: textColor,
align: textAlign,
- verticalAlign: 'middle'
+ verticalAlign: 'middle',
+ width: maxSize.width - textX,
Review Comment:
If legend is layout horizontally, the "break" effect would be wrong.
And if the text has `textStyle.backgroundColor`, the effect would be broken by this change, since textStyle.width is shared by backgroundColor and overflow currently.
I think this feature currently can only serve for vertical layout.
And set width only if `overflow: 'truncate' | 'break' | 'breakAll', for `textStyle.backgroundColor` compromise.
And zrender need upgrade to support a more wise setting about text width, like maxWidth.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org