Black Lives Matter. Please consider donating to Black Girls Code today.

Update dcc.Graphs by selecting trace from other chart

Hi, i have a dashboard which cointains multiple graphs. All graphs are created outside of the app.Layout. like this.
I have several more graphs.

All graphs contain the Date Value, so each date is a trace in this graph on xaxis i have the time in hours and on y different values. I want to select a date (trace) from e.g. fig5line (id="g5) and fig6line (id="g6) should update so that i have only the selected trace in g6.

I found some examples, but i cant use a forloop and sometimes later there might be 3 or 5 or 7 traces so i think i have to create the figures outside of app.layout. Please help if anyone has an idea. Thank you very much

#5. chart, line and markers
fig5line = px.scatter(dfresult, x="Time", 
                      y="Total Feed In", 
                      title = "Energy ",


name = []
name = dfresult.Date.unique().tolist()

for i in range(len([i].update(mode='markers+lines',name=str(name[i]))
#6. chart, line and markers
fig6line = px.scatter(dfresult, x="Time", 
                      y="Wind Speed", 
                      title = "",

app.layout = html.Div([
                                             "height": graphheight,
                                                   'display': 'inline-block', 
                                                  "height": graphheight,
                                                   'display': 'inline-block',