Scrollbars
There are two major approaches to scrollbars in Highcharts.
- Native scrollbars for mobile
These scrollbars are applied by setting a scrollablePlotArea with a minWidth. When the width of the plot area becomes less than this, it is applied to a separate div in the page, where native, smooth scrolling is applied, while the axes, titles, legend and other elements stay fixed. This provides a great way to support long data series in a narrow mobile view. See the effect below in a mobile browser or just a small desktop browser window.
- Axis scrollbars through an API option
These scrollbars are enabled per axis and appear next to the axis. Scrollbars can be applied to any axis in Highcharts Stock.
The full documentation and available options can be seen in our API docs for Highcharts Stock.
In Highcharts Stock charts, the scrollbar is shown below the navigator by default. It is controlled by the top-level scrollbar option, so scrollbar: { enabled: false } hides it. The navigator is a separate component and can be hidden with navigator: { enabled: false }. Together they form the navigation area at the bottom of the chart. To hide that whole area, for example on small screens, disable both.
Setting xAxis: { scrollbar: { enabled: true } } adds another, separate X axis scrollbar, which is disabled by default. A Y axis scrollbar can be enabled the same way, with yAxis: { scrollbar: { enabled: true } }. The xAxis.scrollbar option does not replace or configure the scrollbar below the navigator, so both are shown. To control the scrollbar below the navigator, use the top-level scrollbar option instead.
Scrollbars are not limited to stock charts or Y axis. Using the highstock.js file, it can be applied to regular Highcharts axes too. See examples of: