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

AutoSkip label Rotation #3981

Closed
CodePlayer7 opened this issue Mar 3, 2017 · 7 comments
Closed

AutoSkip label Rotation #3981

CodePlayer7 opened this issue Mar 3, 2017 · 7 comments

Comments

@CodePlayer7
Copy link

After using maxTicksLimit or autoSkip the labels are fewer but chartjs may still think they are too crowed and make some rotation.
Anyway we can set maxRotation: 0 to avoid this,

@Jareechang
Copy link
Contributor

do you have an jsfiddle example ? I am currently, implementing a similar feature and most likely could help with this.

@etimberg
Copy link
Member

etimberg commented Mar 4, 2017

axisOptions: {
  ticks: {
    maxRotation: 0 // turns off rotation
  }
}

@etimberg etimberg closed this as completed Mar 4, 2017
@CodePlayer7
Copy link
Author

Do know that,just suggest charjscould do right rotation automatically when using 'autoSkip'

@benmccann
Copy link
Contributor

benmccann commented Feb 16, 2019

Reopening this because I just hit it and agree it's a bug. There is a workaround that works in some cases, but the default behavior does seem suboptimal

@benmccann
Copy link
Contributor

Here's an example. There's no reason to be rotating the labels in this chart: https://codepen.io/anon/pen/XOOWzY

@simonbrunel
Copy link
Member

As discussed on slack, this is not a bug: auto-rotate applies first between minRotation and maxRotation, then autoSkip removes remaining overlapping ticks. This is useful, for example, for responsive charts (demo). The suggested workaround maxRotation: 0 is currently the way to disable auto-rotate.

I think the current options API is confusing, instead I would have use rotation instead of minRotation and added an autoRotate: true/false option to match autoSkip naming. Then either use maxRotation only when autoRotate: true or, instead, pass a number to autoRotate (default true === 90) representing the target rotation limit to prevent overlap. IMO, both autoSkip and autoRotate should have been false by default.

Anyway, closing as it's not a bug and will be documented in #6079

@benmccann
Copy link
Contributor

Thanks for closing. I meant to have #6079 close this issue. It makes more sense to me now that I understand that rotation is supposed to take priority over skipping. I think the current option names are fine

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

No branches or pull requests

5 participants