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