Chart features help

When I plot my data, which is a dictionary with multiple series (e.g. altitude, latitude) using st.line_chart(), it looks like this:

I would like the following features, but I’m new to Vega-lite/Altair so I’m hoping for some guidance:

  1. I would like to limit the max number of data points shown, and have a scrollbar to scrub along the data. Bonus points if the the scrollbar is resizable. What I used previously that met these requirements was Recharts with the Brush feature:

  2. I would like to select the series to show. The graph looks like a mess with all series showing, so being able to select only 1 or 2 of the series dynamically (e.g. altitude and latitude) would be best. Ideally they have individual axes, maybe on opposite sides of the graph.

I’m assuming I need to use the altair_chart or vegalite chart functions with parameters, but the vega-lite documentation has a lot of jargon so any help would be appreciated. (For starters, what do they call a series?)


Update: I figured out how to select the series to show. Instead of using a list of dicts, I used a pandas dataframe and then used a st.multiselect to select series from the dataframe to pass to the line chart function. Any help on the scrubbing would still be appreciated.