tradingview/lightweight-charts

Update from 3.8 to 4.1 and charts not automatically fit on update

ne0c0de opened this issue · 4 comments

Lightweight Charts™ Version:

4.1

Actual behavior:

I'm using same code as I written and works well in 3.8

Expected behavior:

After 4.1 version update the chart is not fitting the new values that I added to chart bu .update method (not in candle stick charts and even on line series charts too)

Would you be able to share an example we could try locally or even inspect?

here it is: https://jsfiddle.net/hardc0der/Lwk9o80n/2/ @romfrancois

After open the fiddle, wait at least 1 minute to see how to new 1minute candle stay hidden on the right side of the chart

Thanks for providing this fiddle, very helpful.
Following our recent release, I would suggest adding shiftVisibleRangeOnNewBar to your timeScale object.

Otherwise and depending on your logic, you could also rely on scrollToRealTime or scrollToPosition

scrollToRealTime resolves my issue, thank you so much