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

xAxis.ceiling not correctly honored when scrolling when xAxis.min is not set. #16245

Closed
marklofdahl opened this issue Aug 23, 2021 · 2 comments · Fixed by #16259
Closed

xAxis.ceiling not correctly honored when scrolling when xAxis.min is not set. #16245

marklofdahl opened this issue Aug 23, 2021 · 2 comments · Fixed by #16259
Assignees

Comments

@marklofdahl
Copy link

Expected behaviour

When xAxis.min is null or not present, xAxis ceiling should be honored correctly, like it is when xAxis.min is 0.

Actual behaviour

When xAxis.min is not present (or is null), xAxis ceiling is not correctly honored when scrolling. When the chart is initially displayed, the ceiling is correctly honored. When the scrollbar is moved, an additional column is shown when it shouldn't be.

Live demo with steps to reproduce

problem when xAxis.min is not set - https://jsfiddle.net/marklofdahl/quLdrbch/
correct when xAxis.min is 0 - https://jsfiddle.net/marklofdahl/tar6gdwq/

Product version

Highstock 9.1.2

Affected browser(s)

All

Is there a different workaround other than setting xAxis.min = 0 for all my charts?

@highsoft-bot highsoft-bot added this to To do in Development-Flow via automation Aug 23, 2021
@raf18seb
Copy link
Contributor

raf18seb commented Aug 24, 2021

Hi @marklofdahl, thanks for creating the ticket.

The bug is about calculating the xAxis.minRange. When setting xAxis.min or xAxis.max, then minRange is null and it's working fine.
However, if neither min nor max are set, then the default minRange is calculated to 5 (5 times smallest interval). Then, if the ceiling is set to a number smaller than 5, e.g. 3, when dragging the scrollbar, it jumps from 3 to 5.

Summarizing: ceiling (and probably floor as well) should affect the minRange just the same as the min and max do.

It's not related to Stock (yes, the scrollbar is a Stock's feature, but the bug is about calculating the minRange).

Simplified demo: https://jsfiddle.net/BlackLabel/s52yx6d1/

Workaround: set xAxis.minRange: 1: https://jsfiddle.net/BlackLabel/Lhq6ms3c/

@marklofdahl
Copy link
Author

Thanks! I can use the workaround until it is fixed.

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

Successfully merging a pull request may close this issue.

4 participants