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

Unable callback graph

$
0
0

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()

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles