Black Lives Matter. Please consider donating to Black Girls Code today.
Dash Enterprise delivers an incredible 21x cost savings 💸Download the e-book!

Unable callback graph

Unable to display graph using callback in dash. Core components are loading perfectly. Getting blank page on the dashboard

Below is my sample code:

external_stylesheets = [‘https://codepen.io/chriddyp/pen/bWLwgP.css’]
app = dash.Dash(‘name, external_stylesheets=external_stylesheets’)
animals=[‘giraffes’, ‘orangutans’, ‘monkeys’]

app.layout = html.Div([
html.H1(children=‘Confusion Matrices’),
html.Div(children=’’’
Confusion Matrix of Ensemble Models
‘’’),
html.Div(id=‘bar-graph’),
])

@app.callback(Output(‘bar-graph’, ‘children’),
[Input(‘actual-data’, ‘animals’)])

def bar_graph(animals):
bar_fig = go.Figure([go.Bar(x=animals,y=[10,23,60])])
children = [ dcc.Graph(
id = ‘example’,
figure = bar_fig)]
return children

app.css.append_css({‘external_url’: ‘https://codepen.io/chriddyp/pen/bWLwgP.css’})

if name == ‘main’:
app.run_server()

Hi @dmb007, inside the callback you are using the id ‘actual-data’ as an input. But I can’t find any element in your layout with this id. Don’t have to add an input element to your layout?