Skip to content

Use static offsets for panning rounded time scale #474

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

Merged
merged 1 commit into from
Apr 28, 2021

Conversation

kurkle
Copy link
Member

@kurkle kurkle commented Apr 27, 2021

Fixes #388

The time scale rounds down. So when the max goes some amount less than a day over the max, it is rounded down and thus the scale is not changed. On the other hand if we go just a millisecond lower than min, it is immediately changed by a full day.

This adds offset based on the round value, to halfway of the round. So in the day case, 12 hours is added to the min/max before applying the delta.

This alone is not enough, because if the move is not big enough, then there is no change and the delta is reset.
=> Cumulative delta is stored in state until a change occurs.

@kurkle kurkle added the bug label Apr 27, 2021
@kurkle kurkle merged commit 7289efd into chartjs:master Apr 28, 2021
@kurkle kurkle deleted the time-round branch April 28, 2021 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When round is set, I can not pan the graph to the right.
2 participants