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

[Feature] Fit visible candles for the most recent data. #485

Open
e0 opened this issue Sep 26, 2023 · 0 comments
Open

[Feature] Fit visible candles for the most recent data. #485

e0 opened this issue Sep 26, 2023 · 0 comments

Comments

@e0
Copy link

e0 commented Sep 26, 2023

Feature Description

Hi, first of all, thank you for all the work on this library. It's by far the best JS stock chart lib I've seen.

Currently, as one scrolls through the chart, it does a great job of fitting all of the candles so that the visible high is as high as possible and the visible low is as low as possible. However, this seems to stop applying if the chart is scrolled so that only the most recent data is shown. Please see screenshot below how all the candles are near the center of the chart and not fitting to the available vertical space.

It would be great if there could be an option (or change the default behavior) so that the chart still fits the candles for these cases.

I investigated a bit and I think this may be related to the getVisibleRange not being updated anymore for these cases. If I'm not mistaken, I think this is the function responsible: https://github.com/liihuu/KLineChart/blob/main/src/store/TimeScaleStore.ts#L134

image

To Do

@liihuu do you think this is a good change? If so, I'm happy to try to make a PR for it.

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

No branches or pull requests

1 participant