xpdt
Posts: 7
Joined: Thu Feb 15, 2024 1:12 am

Zoom the chart on the x-axis

Hi
On the TradingView, we can zoom in or out of the chart by scrolling the mouse on the y-axis and pan.
Is it possible on Highcharts like the video below:
https://www.youtube.com/watch?v=jW_-yGO9HMM
xpdt
Posts: 7
Joined: Thu Feb 15, 2024 1:12 am

Re: Zoom the chart on the x-axis

Sorry, I wrote the topic wrong, I mean y-axis
pawelys
Site Moderator
Posts: 1021
Joined: Wed Sep 02, 2020 10:37 am

Re: Zoom the chart on the x-axis

Hello,

As it stands, the standard Highcharts package doesn't include a functionality that lets you zoom in and out on the y-axis while panning around, akin to what you might witness on TradingView. That said, there is a possibility to create a custom solution from your end can make this possible.

You are welcome to review this demo which presents how such a feature could be realized: https://jsfiddle.net/BlackLabel/h3w81eoa/
Remember, this is a custom feature that falls to you to maintain, as including it as part of Highcharts' main library isn't on our current development roadmap.

Let me know, if you have any further questions!

Kind regards,

We appreciate your understanding and are here to assist with any questions you may have.
Paweł Lysy
Highcharts Developer
xpdt
Posts: 7
Joined: Thu Feb 15, 2024 1:12 am

Re: Zoom the chart on the x-axis

Thanks, Can you add the y-axis panning feature to this example?
pawelys
Site Moderator
Posts: 1021
Joined: Wed Sep 02, 2020 10:37 am

Re: Zoom the chart on the x-axis

To set up yAxis panning, you can utilize the API option below:

Code: Select all

chart: {
  panning: {
    enabled: true,
    type: 'y'
  }
}
Here's a practical demonstration: https://jsfiddle.net/2ne891vj/

And the corresponding API option reference: https://api.highcharts.com/highcharts/chart.panning

We are here for any inquiries, so please don't be shy if you have any questions. Remember, no question is considered minimal. We enjoy solving challenges and making developers' lives easier.
Paweł Lysy
Highcharts Developer
xpdt
Posts: 7
Joined: Thu Feb 15, 2024 1:12 am

Re: Zoom the chart on the x-axis

Thanks so much :wink: :wink:
pawelys
Site Moderator
Posts: 1021
Joined: Wed Sep 02, 2020 10:37 am

Re: Zoom the chart on the x-axis

PS: Feel free to add the thumbs up to the GitHub feature request if you want the feature to be implemented directly in highcharts: https://github.com/highcharts/highcharts/issues/21335
Paweł Lysy
Highcharts Developer

Return to “Highcharts Usage”