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

Bad ticks with time scale #2964

Closed
ghost opened this issue Jul 13, 2016 · 2 comments · Fixed by #3064
Closed

Bad ticks with time scale #2964

ghost opened this issue Jul 13, 2016 · 2 comments · Fixed by #3064

Comments

@ghost
Copy link

ghost commented Jul 13, 2016

Some date of mine are graphed using a line graph and a time scale. I end up with this graph:

screenshot

As you can see, the July tick is missing.

The related code in scale.time.js seems to be:

if (roundedEnd.diff(me.lastTick, me.tickUnit, true) !== 0) {
     // Do not use end of because we need me to be in the next time unit
     me.lastTick = me.getMomentStartOf(me.lastTick.add(1, me.tickUnit));
}

Patching it to:

if (roundedEnd.diff(this.lastTick, this.tickUnit, true) >= 0) {
     // Do not use end of because we need this to be in the next time unit
     this.lastTick = this.getMomentStartOf(this.lastTick.add(1, this.tickUnit));
} else if (roundedEnd.diff(this.lastTick, this.tickUnit, true) < 0) {
     this.lastTick = roundedEnd;
}

gave me the expected graph.

JsFiddle showing the issue: https://jsfiddle.net/Regisc/kbdn6dpp/

@awallat
Copy link
Contributor

awallat commented Jul 14, 2016

I think this issue is related to #2560

@ghost
Copy link
Author

ghost commented Jul 14, 2016

@awallat I saw this issue, yes maybe related.

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

Successfully merging a pull request may close this issue.

2 participants