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] yAxis.nameTruncate not working #20501

Closed FirstVertex closed 1 week ago

FirstVertex commented 1 week ago

Version

5.5.1

Link to Minimal Reproduction

Echarts playground link

Steps to Reproduce

  1. Visit above playground link with small-ish viewport so the y axis labels will be truncated. (or use horizontal slider in playground to make chart viewport narrow)
  2. on yAxis with type: 'category', see the usage of nameTruncate option.
  3. notice it is not functioning as described in the documentation

Current Behavior

The label was not truncated according to the maxWidth input. When the label is long, only the last few characters are visible, which is an awkward way to identify the data.

Expected Behavior

Expect nameTruncate option to work as described in the docs. Expect that it should show nameTruncate.maxWidth characters, and if the string is longer, it should show the ellipsis. This way, the user will be able to read the first part of the name, which they will more easily recognize than the last part of the name.

Environment

This is reproducible in the live echarts playground.  See attached link.

Any additional comments?

Thank you. Much love for echarts ❤️

helgasoft commented 1 week ago

not-a-bug, nameTruncate is for the axis name, which you don't even have. What you want is yAxis.axisLabel.overflow - Demo 📌 please close issue if problem solved.

FirstVertex commented 1 week ago

Sorry I didn't know about that option! Thank you for the explanation. Have a niiiiiice day 😃