#Graph1
compFig = px.bar(data_frame=playerData, x="season.season_name", y="Goals",
text = "Goals", title = "<b> Total Goals </b> (per season)",
labels = {"Goals":"", "season.season_name": ""})
compFig.update_traces(textposition = 'inside')
compFig.update_layout(height = 500, width=700,title={"x": 0.5, "y":0.9},
xaxis={"showgrid": False},yaxis={"showgrid": False},
plot_bgcolors=colors['background'], paper_bgcolors=colors['background'],
font_colors=['text'])
#Graph2
compFig2 = px.bar(data_frame=playerData,
x="season.season_name", y="Assists",
text="Assists",title="<b>Total Assists </b> (per season)",
labels={"Assists": "", "season.season_name": ""})
compFig2.update_traces(textposition = 'inside')
compFig2.update_layout(height = 500, width=700,title={"x": 0.5, "y":0.9},
plot_bgcolors=colors['background'],
plot_bgcolors=colors['background'],
font_colors=colors['text'])
app.layout = html.Div(style = {'backgroundColor': colors['background']},children=[
html.H1(children="Football Analytics Dashboard",
style = {"text-align": "center",
"color": colors["text"]}),
html.H2(children="by Boniface Boben",
style = {"text-align": "center",
"color": colors["text"]}),
html.H1(children="Lional Messi",
style = {"color": colors["text"]}),
html.Div(children=[
dcc.Graph(id="sb-comp-graph", figure=compFig,
style={"box-shadow": "5px 5px 5px #888"}),
dcc.Graph(id="sb-comp-graph-2", figure=compFig2,
style={"box-shadow": "5px 5px 5px #888"})
], style={"display": 'flex', 'align-items': 'center', "right-margin": 0})
])
Hi @boniface welocme to the forums.
A “Hi” and a few words would be appreciated.
The error message is explicit, try removing the “s” from all of your “_colors”.
https://plotly.com/python-api-reference/generated/plotly.graph_objects.Figure.html