Adding points or bars while scrolling leads to timescale jumps #1521
Labels
bug
Unexpected problem or unintended behavior.
good first issue
Good issue for first-time contributors.
Milestone
Lightweight Charts™ Version: 4.1.3
Steps/code to reproduce:
Actual behavior:
The timescale jumps to the right by 50 days every 3 seconds while scrolling is in process.
Expected behavior:
No jumps, just scrolling proportional to mouse movements.
Also can be reproduced in TradingView. Select the smallest possible timeframe (1m for free plans), scale the chart to make bars bigger in order to make jumps more noticeable. Then start to scroll slowly. When new candle appears, the timescale will jump to the right by one bar.
Let me know if there is a way to work around this issue. I couldn't find any. I want to append new candles while user is scrolling to the right and more candles become visible. But this makes the chart to jump by the number of added candles.
Option shiftVisibleRangeOnNewBar has no effect because it isn't applicable to this case. Both setData and update have the same behaviour.
By the way, adding new candles into the beginning (candleArray.unshift + setData) doesn't have any issue, no jumps happen in that case.
The text was updated successfully, but these errors were encountered: