Black Lives Matter. Please consider donating to Black Girls Code today.

Annotations in line chart

Hello Team,

I have a line chart with three lines on Y axis as below

I would like to add annotations to all lines.

Below is my code. Please help here
from plotly.offline import download_plotlyjs, init_notebook_mode, iplot
from plotly.graph_objs import *
from plotly import tools
import plotly
plotly.offline.init_notebook_mode()
import pandas as pd
import numpy as np

df = datasets[0]

x = df.fiscal_period
y1 = df.days_to_onboard
y2=df.days_to_consume
y3=df.days_to_expand

xcoord = df.fiscal_period

annotations1 = [dict(
x=xi,
y=yi,
text=str(yi),
xanchor=‘auto’,
yanchor=‘bottom’,
showarrow=False,
) for xi, yi in zip(xcoord, y1)]

annotations = annotations1

trace1 = Scatter(
x=x,
y=y1,
name=‘Days to onboard’
)
trace2 = Scatter(
x=x,
y=y2,
name=‘Days to consume’
)
trace3 = Scatter(
x=x,
y=y3,
name=‘Days to expand’
)
data = [trace1,trace2,trace3]
layout = Layout(
width=1200,
height=475,
annotations=annotations,
xaxis=dict(
title=‘Fiscal Period’
),
yaxis=dict(
title=‘Time to onboard’
)

)

fig = Figure(data=data, layout=layout)
iplot(fig)

This looks like a python problem. Best for #api:python

Should I post it there?

This has been resolved.