Skip to content Skip to sidebar Skip to footer

Dash Output With Multiple Inputs

I am trying to have a dash component properly input variables and give appropriate output. Currently multiple inputs will make the functionality not work. I've put multi=true for m

Solution 1:

I'm not able to fully run your code to debug it well, I found this after a quick glance.

When the xaxis-columnDropdown component is changed to do a multi-select, it will return a list rather than a value, so the callback you have for xaxis-column will be erroneous,

Changing the callback to something like this should work,

@app.callback(
    Output('indicator-graphic', 'figure'),
    [Input('xaxis-column', 'value'),
     Input('xaxis-type', 'value')])defupdate_graph(xaxis_column_name, xaxis_type):
    graph = []
    for i inrange(0, len(xaxis_column_name)):
        graph_obj = go.Scatter(
            x=df.index,
            y=df[xaxis_column_name[i]])

        graph.append(graph_obj)
    return {
        'data': graph
    }

Post a Comment for "Dash Output With Multiple Inputs"