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

Time.unit property is being ignored/not working correctly in the latest version (2.7.2). #5488

Closed
nfplay opened this issue May 13, 2018 · 3 comments

Comments

@nfplay
Copy link

nfplay commented May 13, 2018

In the latest version - 2.7.2 - the "unit" property in time scale is not working. In version 2.6.0 is working just fine.

Working (2.6.0): Fiddle
Not working (2.7.0) :Fiddle.

Here the time unit is set to "month", but it is being ignored/not working correctly in the latest version. If one changes to the previous version, 2.6.0, the problem goes away.

options: { scales: { xAxes: [{ type: 'time', time: { displayFormats: { 'millisecond': 'MMM DD', 'second': 'MMM DD', 'minute': 'MMM DD', 'hour': 'MMM DD', 'day': 'MMM DD', 'week': 'MMM DD', 'month': 'MMM DD', 'quarter': 'MMM DD', 'year': 'MMM DD', }, unit:'month' } }], }, }

@etimberg
Copy link
Member

@simonbrunel @benmccann thoughts?

@simonbrunel
Copy link
Member

time.unit is not ignored but since your minimum range includes all your data (< 1 month), then ticks are not displayed because out of the view. You need to set scale.bounds: 'ticks' to make sure your range is fully displayed (fiddle). This behavior has changed in 2.7.0 (#4556).

@nfplay
Copy link
Author

nfplay commented May 16, 2018

Fantastic! That was it 👍
Thank you!

@nfplay nfplay closed this as completed May 16, 2018
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

3 participants