candlestick chart auto scroll to the final item when data is update
Currently, I am using a webview to display the html code (I am coding on React Native) to display the candlestick chart, but there is one problem: I am currently setting the data as
const candleSeries = chart.addCandlestickSeries();
const rawData =${JSON.stringify(data)};
candleSeries.setData(data);
Then in the react native code, I placed a useEffect to capture the Socket to update the data
useEffect((): any => {
handleGetChart() // this is the code to get data
}, [newSocket])
It was able to update data continuously, but now the problem is that when I'm scrolling to another location and the data changes (my API will return a new value every 0.2s), it will automatically scroll back to the new location. final position of the chart. I don't know if there is any way to solve this problem. Thank you very much.