I have cleaned the dataframe and plotting these graphs on plotly and work fine on Dash. I want to insert a dropdown for x-axis (i.e, Y and P for both the graphs separately). I am trying with dcc.dropdown but it's not working.
I have been trying with this but am confused about the dcc dropdown. Any help would be appreciated, I am new to Dash!
fig1 = px.line(df_1, x='Y',y=['x','y']) fig2 = px.line( df_2, x='P',y=['x','y'])
`app.layout = html.Div(children=[ # All elements from the top of the page html.Div([ html.H1(children='...'),
html.Div(children='''
'''
'''),
dcc.Graph(
id='graph1',
figure=fig1
),
]),
# New Div for all elements in the new 'row' of the page
html.Div([
html.H1(children=''),
html.Div(children='''
'''),
dcc.Graph(
id='graph2',
开发者_StackOverflow figure=fig2
),
]),
])
if name == 'main': app.run_server(debug=True, use_reloader = False)`
精彩评论