I have this pandas dataframe
index cath_date
0 2015 65
1 2016 88
2 2017 106
3 2018 97
0 2019Q2 120
6 2019Q1 101
17 2019Q3 48
I tried to plot a line graph using plotly trying this code
x= df['index'].values.tolist()
y= df['cath_date'].values.tolist()
fig = go.Figure(data=go.Scatter(x= df['index'].astype(str).tolist(), y= y,
text= y,textposition= 'top center', mode='lines+markers',
hovertemplate='Avg: %{y} <br> Year: %{x}<extra></extra>'))
fig.update_layout(title_text='PPCI Primary Average 2015-2018',
xaxis= dict(dtick = 1, title=dict(text="Year"), showgrid = True),
yaxis = dict(rangemode="tozero",autorange=True, title=dict(text="Average"), showgrid= True))
fig.show()
as you can see the values 2019Q1, 2019Q2, 2019Q3 so, what is the problem