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

[BUG] autoScale of priceScale can not work after setDate #1759

Closed
yoyo201626 opened this issue Dec 18, 2024 · 2 comments
Closed

[BUG] autoScale of priceScale can not work after setDate #1759

yoyo201626 opened this issue Dec 18, 2024 · 2 comments
Labels
question General question.

Comments

@yoyo201626
Copy link

Lightweight Charts™ Version:
^4.2.0
Steps/code to reproduce:

  1. go to lightweight-charts official document website -> tutorials -> Example -> range-switcher

  2. look at the chart example
    image

  3. scroll up priceScale
    image

  4. drag the chart up
    image
    image

  5. change range to “1W”
    image

Actual behavior:

the chart can not auto Scale to effective curve
image

Expected behavior:

I expected Provides apis to control priceScale, just like timeScale , or make autoscale fix

Screenshots:

CodeSandbox/JSFiddle/etc link:

@SlicedSilver SlicedSilver added the question General question. label Dec 18, 2024
@SlicedSilver
Copy link
Contributor

It is the expected behaviour that the chart maintains the price scale position / range defined by the user manually.

If you would like to reset the price scale then you can apply the autoScale: true option via the price scale api. For example:

chart.priceScale('right').applyOptions({ autoScale: true });

@yoyo201626
Copy link
Author

It is the expected behaviour that the chart maintains the price scale position / range defined by the user manually.

If you would like to reset the price scale then you can apply the autoScale: true option via the price scale api. For example:

chart.priceScale('right').applyOptions({ autoScale: true });

It work when i put priceScale().applyOptions({ autoScale: true }); before setData ! Thank you @SlicedSilver .
I thought the default value of 'autoscale' was' true 'which meant that auto scaling was always active:

image

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

No branches or pull requests

2 participants