apache / echarts

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

[Bug] - All X-Axis labels are not shown #20014

Open kalyanvedurumudi opened 3 months ago

kalyanvedurumudi commented 3 months ago

Version

5.5.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=line-simple&version=5.4.3&code=PYBwLglsB2AEC8sDeBYAULTsBEBzAThACbYBcy6WVOANgKYBmYZsADADSXWbaG4AWzchy7dsAI2BgwwALYsAzK1GwAvpwxZsADwCC2iAGcWAbRVVUm7lWxEAhmDunz1m4buyQ9WAEZY7z3psDVdXbACvOlgAJn8PSOCXUJwI7wU4wLpEq2StVKiAFgyEkNy3eO8AVmKg0rKefNgANhqsuvreOllgADcosH4o6DptMFgnJOoAXXawuwNDABk7cToaFkt6rQYYMABlCAAvLPIfERyy7F66fAYaYAB3FmwwfABXaABjBzbJsIfiAMWABOc5bBr8R4sV5vOizXLYfjEOgAeT6-BodhALAYdhohjofywqkmJJyMxU2AAnvojM4LlhNgjDJCnuQYYSGZgyVQpuhVABuIA

Steps to Reproduce

I have a simple chart, with 7 labels on the x-axis.

below are the options for axislabel under x-axis.

"axisLabel": { "fontSize": 10, "overflow": "truncate", "width": 90, "show": true, "hideOverlap": false } The label seems to be truncated if the width of the label is exceeded more than 90 and ellipsis can be seen.

ISSUE: All the labels are not seen and only alternative labels are shown in the axis.

By reducing the length of the label from the axis labels, all the labels seem to be rendering. (for ex: please remove the last character from the last label for all the labels to render)

Labels hidden image

All labels seen after removing some characters from the labels. image

Please go through the below link for the issue reproduction.

https://echarts.apache.org/examples/en/editor.html?c=line-simple&version=5.4.3&code=PYBwLglsB2AEC8sDeBYAULTsBEBzAThACbYBcy6WVOANgKYBmYZsADADSXWbaG4AWzchy7dsAI2BgwwALYsAzK1GwAvpwxZsADwCC2iAGcWAbRVVUm7lWxEAhmDunz1m4buyQ9WAEZY7z3psDVdXbACvOlgAJn8PSOCXUJwI7wU4wLpEq2StVKiAFgyEkNy3eO8AVmKg0rKefNgANhqsuvreOllgADcosH4o6DptMFgnJOoAXXawuwNDABk7cToaFkt6rQYYMABlCAAvLPIfERyy7F66fAYaYAB3FmwwfABXaABjBzbJsIfiAMWABOc5bBr8R4sV5vOizXLYfjEOgAeT6-BodhALAYdhohjofywqkmJJyMxU2AAnvojM4LlhNgjDJCnuQYYSGZgyVQpuhVABuIA

Expectation: All labels should be shown, and if the label length exceeds the width specified, the labels exceeding should be truncated.

Current Behavior

Labels hidden when the length of the label is longer, even after width and overflow options are given.

Expected Behavior

All labels should be shown, based on the width and overflow options, the label should be either wrapped or truncated.

Environment

- OS:Windows
- Browser: chrome
- Framework:

Any additional comments?

No response

helgasoft commented 3 months ago

(A) All labels should be shown, (B) based on the width and overflow options, the label should be either wrapped or truncated.

A: use interval, B: use shorter width to see truncation - Demo