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

New Feature: axisLabel.autoRotate #14996

Open
ataft opened this issue May 19, 2021 · 10 comments
Open

New Feature: axisLabel.autoRotate #14996

ataft opened this issue May 19, 2021 · 10 comments
Labels
en This issue is in English new-feature

Comments

@ataft
Copy link

ataft commented May 19, 2021

What problem does this feature solve?

If the axis labels do not fit, then autoRotate will automatically calculate axisLabel.rotate to make them fit.

axisLabel.interval='auto' will cause missing/skipped labels, like this:
image

axisLabel.interval=0 will cause collision, like this:
image

In my opinion, autoRotate will go from 0 to 45 to 90 degrees, depending on the fit, like this:
image

What does the proposed API look like?

axisLabel.rotate = () => {
  if(this.doesNotFit && this.autoRotate) {
    this.rotate = calcRotateDegrees();
  }
  ...
}

@echarts-bot
Copy link

echarts-bot bot commented May 19, 2021

Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that it contains a minimum reproducible demo and necessary images to illustrate. Otherwise, our committers will ask you to do so.

A minimum reproducible demo should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.

You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.

If you are interested in the project, you may also subscribe our mailing list.

Have a nice day! 🍵

@echarts-bot echarts-bot bot added en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature. waiting-for: community labels May 19, 2021
@ataft
Copy link
Author

ataft commented May 19, 2021

If axisLabel.autoRotate is implemented, then issue #9265 needs to be resolved so that axis name and axis label do not overlap, as shown here:
image

@pissang pissang removed pending We are not sure about whether this is a bug/new feature. waiting-for: community labels May 25, 2021
@akhilshastri
Copy link

it seems must to have, is there any workaround meanwhile ..?

@DavidMarquezF
Copy link

sadly it doesn't look like it. I guess the best thing you can do is listen to size change and then rotate the labels yourself, but it will not be the most robust solution

@TuringLovesDeathMetal
Copy link

TuringLovesDeathMetal commented Jun 20, 2022

+1 for this issue. We've had loads of users requesting that the labels don't overlap, but are all shown!

Also love the implementation suggested by @ataft (i.e. If labels overlap at 0 degrees, rotate them to 45 degrees, then once the labels overlap at 45 degrees, we should rotate them to 90 degrees)

I'd also add that if labels overlap at 90 degrees, then remove all labels (or go back to the auto labels where values are skipped)

@dd1994
Copy link

dd1994 commented Aug 23, 2022

+1 for this

@axispod
Copy link

axispod commented Oct 14, 2022

+1, we want the feature

@jesuino
Copy link

jesuino commented Mar 30, 2023

+1 Please implement this

@agurtovoy
Copy link

In case anyone waiting for this would like to test this out: #19348

@108EAA0A
Copy link

I am encountering this very problem right now.
I would like to see this PR merged as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
en This issue is in English new-feature
Projects
None yet
Development

No branches or pull requests

10 participants