kruthika s
Posts: 10
Joined: Tue Jan 18, 2022 12:57 pm

Scrollplot area

Hi ,
I have used ScrollPlotarea options for scrolling in bar chart

The problem I am facing is when I scroll down ,and click on a reset button which resets the data the scrolling is not pointing to top but data is refreshing

I want whenever I click on the button the scroll should reset to the top I have given scrollPositionY=0
How can I achieve that?

Thank you in Advance
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Scrollplot area

Hello,

Thanks for contacting us with your question!

You can use setExtremes() method to achieve this.

Demo: https://jsfiddle.net/BlackLabel/gshu86o7/
API: https://api.highcharts.com/class-refere ... etExtremes

Let me know if you have any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
kruthika s
Posts: 10
Joined: Tue Jan 18, 2022 12:57 pm

Re: Scrollplot area

Thank you for the reply

I agree we can use SetExtremes like .setextremes(0,4) but instead of 4 how can I set based on the minhieght which is declared in scrollbarplotarea since we don't have prior knowledge of how many data can be fit in the area
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Scrollplot area

Hi,

Ok, so in that case if you are using the chart.scrollablePlotArea option you can do it using the Javascript Window.scroll() method.

Demo: https://jsfiddle.net/BlackLabel/1nqLdbe8/
MDN API: https://developer.mozilla.org/en-US/doc ... dow/scroll

Let me know if you have any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Usage”