mayag
Posts: 23
Joined: Thu Dec 15, 2022 9:58 am

mouse scroll zooms in and out

Hi once again,

I want to add the option to do mouse scroll zoom in and out that will also be active mobile (touch)
(The functionality should behave like google maps)

Is it possible to do this in Highcharts.chart type line?

I found this https://jsfiddle.net/mwx71zr0/1/ but, it doesn't fully meet my requirements.
As you can see here every time you zoom it leads to the end of the chart and not to the mouse location.

Thanks!
User avatar
dawid.d
Posts: 837
Joined: Thu Oct 06, 2022 11:31 am

Re: mouse scroll zooms in and out

Hi,

Thanks for contacting us with your question!

This can be done by writing your own logic similar to the example you posted. The difference is that the mouse position should be taken into account. An example solution is in the demo below.

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

Let me know if that was what you were looking for!
Best regards
Dawid Draguła
Highcharts Developer
mayag
Posts: 23
Joined: Thu Dec 15, 2022 9:58 am

Re: mouse scroll zooms in and out

He, it is what i was looking for but not in this view..
as i said, i want to implement it in Highcharts.chart but, even if i can where can i read more about it?
if i want to change the position of date-picker, remove navigator outline and where is the legend?
i would like to read more about it.

thanks, Maya.
User avatar
dawid.d
Posts: 837
Joined: Thu Oct 06, 2022 11:31 am

Re: mouse scroll zooms in and out

Hi,

This will work regardless of whether it is a stock chart or a regular chart.

Touch-related zoom, on the other hand, is enabled by the zooming attribute.
See: https://api.highcharts.com/highcharts/chart.zooming

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

I hope you will find it useful
Regards!
Dawid Draguła
Highcharts Developer

Return to “Highcharts Stock”