How to add horizontal scroll bar for a visualization?

I have a chart showing oil wells (depicted by series of vertical parallel rectangles created primarily through add_segments) which will be imported into Power BI later. When the number of wells exceeds 10 or so, the rectangles start becoming thinner to the point that the labels cannot be read. How can I add a horizontal scroll bar without the use of other R packages (like Highcharter since I need to use this in Power BI)?

Hey @addy

How do you mean a scrollbar?! You can set the yaxis range to show a certain amount i.e. yaxis = list(range = c(0,10)) and then simply drag the yaxis up and down using the cursor. Alternatively, you can set dragmode = pan

If you’re wanting something that you can see and use, then consider using sliders that update the yaxis. However, sliders can only be oriented left-right not top-bottom, which may be confusing to use.

Thanks @bcd ! Both dragmode and yaxis work perfectly.