Skip to content

Setting minimal width of Scrollbar thumb

This tutorial will explain how you can set minimal width/height of the chart Scrollbar’s “thumb” - draggable middle section.

OK, so you added a scrollbar (or a couple of) to your chart. This is great because it allows your users to zoom the chart as well as pan the selection. The thumb - grayer mid section that comes between two grip buttons - can be used to pan the selection.

Scrollbar with a gray thumb between two grip buttons

However, if you zoom in even further, the thumb becomes so small, you can even see it, let along drag.

Scrollbar zoomed in so far that the grips touch and the thumb is hidden

The solution us actually super-simple: just set minWidth (or minHeight if it’s a vertical scrollbar) to a minimum number of pixels you don’t want your thumb to shrink beyond.

chart.scrollbarX.thumb.minWidth = 50;
Open in:New tab
Setting minimal width of scrollbar thumb