How to link second subplot trace selection based on first subplot

Hi guys,

Is there a way that I can set up two subplots so that the second one depends on click of the first one?
Please see a manual example below:

from plotly.subplots import make_subplots
import plotly.graph_objects as go

fig = make_subplots(rows=2, cols=1,
                   subplot_titles=("Most Recent","Hisotry"),
                   vertical_spacing=0.25)

fig.add_trace(
    go.Bar(x=to_chart.iloc[:,-1].index, y=to_chart.iloc[:,-1].values, showlegend=False),
    row=1, col=1
)
for this_cat in to_chart.index:
    fig.add_trace(
        go.Line(x =to_chart.columns, y=to_chart.loc[this_cat],name=this_cat, visible = "legendonly"),
        row=2, col=1
    )
fig.update_layout(
    height=800, width=1800
)

fig.update_annotations(font_size=25)
fig.show()

I would like to click on the bar(s) in the first chart and the second chart show the line(s) corresponding to the selection. For example, click on Vitamins bar in the first chart and Vitamins is selected for the second line chart.
Appreciate your thoughts!

Best,
Zach