I am creating a Dash app in Python3. Trying to add in a horizontal line to a bar graph. The examples in the documentation are for line graphs, which have numeric x and y axis, whereas I have a categorical X-axis. The below code creates the graph successfully, but does not show the shape object. How can I add a horizontal line to this graph?
html.Div(
[ dcc.Graph(
id='example-graph-23',
figure={
'data': [
{'x': ['Overall', 'NBA', 'WWC', 'NFL'], 'y': [3,2,2.5],
'type': 'bar', 'name': 'Instagram'},
],
'layout': {
'yaxis' : dict(
range=[0, 4]
),
'plot_bgcolor': colors['background'],
'paper_bgcolor': colors['background'],
'font': {
'color': colors['text']
},
'shapes' : dict(type="line",
x0=0,
y0=2,
x1=5,
y1=2,
line=dict(
color="Red",
width=4,
dash="dashdot",
))
}
}
) ]
, className="four columns"
),