olofens
Posts: 2
Joined: Thu Aug 31, 2023 9:32 am

Mouse Wheel Zoom not working well with xAxis min < dataMin

Thu Aug 31, 2023 9:47 am

Hi,

I have a use case where I want to show entire periods, for example, the xAxis should show the entire current month. However, there might not be data for the entire month. As in, the data might start somewhere in the middle of the chart.

I really love the new mouse wheel zoom feature, so tried adding that. Works great when there's data in the entire chart, but whenever there's only data in the end portion of the chart, it doesn't.

I reproduced it here: https://jsfiddle.net/r7js8yxb/22/

Try to scroll into the data. You'll notice that it takes a few "rotations of the mouse wheel" so to speak before it starts zooming in. And when it does, the xAxis jumps to xAxis.min = xAxis.dataMin. So something's up here, I think its a bug in Highcharts. Or at least a gap in functionality, would be great if you could zoom even in these cases.

jakub.j
Posts: 855
Joined: Tue Jan 24, 2023 11:14 am

Re: Mouse Wheel Zoom not working well with xAxis min < dataMin

Thu Aug 31, 2023 10:11 am

Welcome to our forum and thanks for contacting us with your question!

This bug has already been reported on our GH. You can watch this issue in the link below and track any information for this one.
GH Issue: https://github.com/highcharts/highcharts/issues/19475

As a workaround, you can add a dummy point with null y value, and the same x value as you set xAxis.min to, see:

Demo: https://jsfiddle.net/BlackLabel/gxLk6v52/

Let me know if you have any further questions
Kind regards
Jakub
Jakub
Highcharts Developer

olofens
Posts: 2
Joined: Thu Aug 31, 2023 9:32 am

Re: Mouse Wheel Zoom not working well with xAxis min < dataMin

Thu Aug 31, 2023 10:13 am

You legends, thank you Jakub

Return to “Highcharts Stock”