I have highstock in react application. I've added historical data upload functionality. My problem is that I need to add both historical data and new data which could happen simultaneously. I need to understand where user on the chart currently. If chart was scrolled and user sees historical data I need to do nothing in case of new data was added. But if user sees latest data and chart got new data (not historical one) I need to autoscroll graph to show last data. Of course user can scroll graph back and forward. I was trying to change extremes with next condition:
if ( extremes.userMax === oldMax && extremes.userMax < dataMax ) {
e.target.xAxis[ 0 ].setExtremes(
dataMax - ( userMax - userMin ),
dataMax
);
}
but it doesn't work.
Is it possible to determine current user position on the chart?
Code above was added as event callback for redraw.