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

Label Alignment issue - auto hide #20709

Open
karthik-noveau opened this issue Jan 22, 2025 · 4 comments
Open

Label Alignment issue - auto hide #20709

karthik-noveau opened this issue Jan 22, 2025 · 4 comments
Labels

Comments

@karthik-noveau
Copy link

Version

5.6.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=bar-simple&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5AMYCGYVA5sAE7m0A0J6AE2aMiAbVoBZGFOgy50mL1i0AKgFcqS2gHUqArSoAWarQDEOELQGVm1tdFoBdEgF8-6cjnxFUpMpRplADdGABsNWld3WDwqCypCWFF-Yj9BYTEARgAmAAYeWDz82EyAVmKADmKAdmLMzLqAZlzHaL8KajoAI0YOSL8XEmcXAG4gA

Steps to Reproduce

  1. give long label
  2. you can see , small size labels are hiding even there is space to render

Current Behavior

x axis labels are hiding based on max width of label , it effect to show the small width label also even if there is space to render

Expected Behavior

if label width is long it only hide, don't hide the available space to render label

in given example , 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' should show

beacuse there is space to render Wed', 'Thu', 'Fri', 'Sat', 'Sun'

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Jan 22, 2025
@Ovilia
Copy link
Contributor

Ovilia commented Jan 22, 2025

Not a bug. There is a method to calculate the auto interval so in this case, it's calculated to be 1. You can se axisLabel: { interval: 0 }, to force displaying every label.

@Ovilia Ovilia added support not-a-bug waiting-for: author topic: axis and removed bug pending We are not sure about whether this is a bug/new feature. labels Jan 22, 2025
@MatthiasMert
Copy link

MatthiasMert commented Jan 22, 2025

Two example solutions:

Example 1: hideOverlap

Example 2: truncate

@karthik-noveau
Copy link
Author

but i need to hide the overlapped label with my scenario

@MatthiasMert
Copy link

MatthiasMert commented Jan 22, 2025

You could also use the label formatter to hide labels based on conditions (e.g. length).

Example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants