apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.69k stars 19.62k forks source link

[Bug] Invalid legend (type: scroll) horizontal paddings when data names are too short #20470

Closed Butsyrin closed 2 weeks ago

Butsyrin commented 2 weeks ago

Version

5.5.1

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?code=PYBwLglsB2AEC8sDeAoWtJgDYFMBcya6GOAHmAQOQBKOAZjgE5OzB2wCGsA6jgEYBnCGByUANEXQCArnxHkqAMQ4BrHLAAiHMB3GTYuOhViUAxjmgjGlIgF8J6MMGBZIIAqmIZGEAOa-mKmEcAFsbdHsiXADoABMPfTAATxB8EwFTRhcsPS9gHwtjSgA3JkhTDhyHYkNjAAZqx1AqEIhY2Nxc4j582KZuNrAACwIARkbYEA52iGhfAgBtBtg6gF0J2O0ORcoAZUpVu2qBJggcAUX9Ty9YaA4QtMoAQVNzAQFYRSywiccUx5AZy6XkY0wg0guJgArHUAKTA4ibHSXG7EJCwYqVaRpUZ1AAsAA4xLd7o99rBIqj0OjMVhsQQAOwAZihxLuDyoGggzFMYEoFN-aIxWLSUIJy3ZjwAoiEOBAcgL9F4aSKCIS8WzSVQAKrQKBwJ6xAT8ylUlV0tJMuoSrUmABqbRwwFghuNFKVsHWHtCICGHCEkOuqOCIV2yVwCSpxAEftiwAA7gAhOmMMYND1eGPTBMAeTodBOYAAGgR01GpLGEwBhFz5KiMXx8DgACmWbeJdQAdFCAJThKm2D2DrzDz0oWwAbiAA

Steps to Reproduce

Nothing, just open the demo. I set paddings in 0, but rendered horizontal paddings are not 0.

Current Behavior

On scrollable legend horizontal paddings are invalid when data names are too short. If name is long enough, paddings become correct. In plain legend paddings are corrent too. Tested in chrome and firefox, behavior is the same.

Expected Behavior

Horizontal paddings must be equal to the value specified in the settings

Environment

- OS: windows 11
- Browser: chrome/ff
- Framework:

Any additional comments?

No response

helgasoft commented 2 weeks ago

type:'scroll' adds some horizontal space because it has pageIcons. Their size could be adjusted with pageIconSize. Otherwise padding works correctly both horiz/vertical, regardless of name lengths - Demo image

📌 please close issue if problem solved.

Butsyrin commented 2 weeks ago

With long enough names paddings are OK without setting any pageIconSize properties. demo image Setting pageIconSize solves the problem, but with short and long names behaviour is not the same.