Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Dashboard with 1 callback to update Multiple Graphs

$
0
0

I am trying to update a single dashboard using Dash and Python with multiple graphs (hoping to have 4 but want to start with 2 as baby steps) and I am getting an error.

Error reads:
dash.exceptions.InvalidCallbackReturnValue: The callback …graph_1.figure…graph_2.figure… is a multi-output.
Expected the output type to be a list or tuple but got:
Figure({
‘data’: [{‘alignmentgroup’: ‘True’,
‘hovertemplate’: ‘Sub-System=JE
Business=%{x}
Amount in USD=%{y}’,

My Code for the callback and function is:
@app.callback([Output(‘graph_1’, ‘figure’), Output(‘graph_2’, ‘figure’)],
[Input(‘Business_DropDown’, ‘value’)]
)

def update_graph_1(value):
print (value)
dff = df[df[‘Business’] == value]
fig = px.bar(dff, x=“Business”, y=“Amount in USD”, color=“Sub-System”, barmode=“group”)
return fig

Any help would be greatly appreciated.

Kind regards, Dan

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 6271

Latest Images

Trending Articles



Latest Images