You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add series with only whitespace data, which contains time values per each second (for simplicity). From 9:00 to 11:00 unix time.
Add series with actual data. From 9:45 to 10:15 unix time (thus placing it in the middle of whitespace timeline)
Try to reach left and right end of timeline.
Actual behavior:
Chart supports infinity moving to left side while whitespace series data is present (as expected).
But moving chart forward into right side cause locking move when last bar of main series data riches starting point of timescale.
Expected behavior:
Charts able to move left and right side freely while whitespace is present at timescale.
Thank you for the JSFiddle example which clearly shows the issue.
I'm adding the 'needs investigation' label because we will need to discuss internally whether a change to this behaviour should be the default and expected behaviour going forward, or whether we should put the new behaviour behind an option.
I can see a benefit to both approaches. Additionally, the fact that the behaviour is different for the past (left) direction compared to the future direction is unexpected.
One solution to this is to have all of the area that you want scrollable as whitespace data and the very last data a line data with a NaN value.
Like so:
constwhitespaceStartDate="1970-01-01";constwhitespaceEndDate="2100-01-01";constwhitespaceDateDataset: ((WhitespaceData|SingleValueData)&Numbered)[]=newArray(getNumberOfDaysBetweenTwoDates(newDate(whitespaceStartDate),newDate(whitespaceEndDate),),);// Hack to be able to scroll freely// Setting them all to NaN is much slowerfor(leti=0;i<whitespaceDateDataset.length;i++){constdate=newDate(whitespaceStartDate);date.setUTCDate(date.getUTCDay()+i);constnumber=date.valueOf()/ONE_DAY_IN_MS;consttime=dateToString(date);if(i===whitespaceDateDataset.length-1){whitespaceDateDataset[i]={
number,
time,value: NaN,};}else{whitespaceDateDataset[i]={
number,
time,};}}
Lightweight Charts™ Version: 4.1.4
Steps to reproduce:
Actual behavior:
Chart supports infinity moving to left side while whitespace series data is present (as expected).
But moving chart forward into right side cause locking move when last bar of main series data riches starting point of timescale.
Expected behavior:
Charts able to move left and right side freely while whitespace is present at timescale.
Screenshots:
TradingView.Lightweight.Charts.demo.-.JSFiddle.-.Code.Playground.-.Google.Chrome.2024-05-23.20-20-02.online-video-cutter.com.mp4
JSFiddle link:
https://jsfiddle.net/njw3bed9/1/
The text was updated successfully, but these errors were encountered: