I'm currently running a dropdown menu in Python which has been working perfectly fine.
'stat_option' is loading a list of values to use, and then the callback is sending the value to the dataframe used for the y axis. So far, so good..
dcc.Dropdown(
id='stats_dropdown',
options = stat_opt,
style = {
'width': '35%'
},
),
dcc.Graph(
id='graph',
),
... app.callback ...
@app.callback(
dash.dependencies.Output('graph', 'figure'),
[dash.dependencies.Input('stats_dropdown', 'value')])
def update_graph(value):
datasets = df.to_json()
dff = px.line(df, x = 'time', y = value, color = 'host', line_group = 'host', hover_name = "host", title = 'stats').update_xaxes(categoryorder = "category ascending")
figure = dff
return(figure)
I'd like to create a second dropdown menu that provides a value for the x axis. I create the second dropdown menu, and refer to a list of unique dates in the 'date_opt' variable:
dcc.Dropdown(
id='date_dropdown',
options = date_opt,
style = {
'width': '35%',
},
),
But when I assign a new Input for my date_dropdown:
@app.callback(
dash.dependencies.Output('graph', 'figure'),
[dash.dependencies.Input('date_dropdown', 'value')],
[dash.dependencies.Input('stats_dropdown', 'value')])
I get the following error:
dash.exceptions.IncorrectTypeException: The state argument `date_dropdown.value`
must be of type `dash.State`.
Since this replicates the stats_dropdown, I'm guessing the error has to do with handling more than one Input? I've been searching through the plotly forums, and stackoverflow threads, but haven't had much success in finding out answers for multiple inputs, and am hoping someone with experience in dash can shed some light onto my issue, and where a good place would be to find some answers (an example would be nice too).