---
title: Scrollbars
---

```{r}
library(gglite)
df = data.frame(x = 1:100, y = cumsum(rnorm(100)))
p  = g2(df, y ~ x) |> mark_line()
```

Scrollbars allow users to scroll through data that extends beyond the visible
chart area.

## Scrollbar on X

```{r}
p |> scroll_x()
```

## Scrollbar on Y

```{r}
p |> scroll_y()
```

## Scrollbar on Both Axes

```{r}
p |> scroll_x() |> scroll_y()
```
