So i have a data frame (df_prod) with a time series of the hourly electricity production of some PV-panels. I have a graph and would like to annotate the peak value.
I know how to find the value, but I can't figure out how to put the date of when the peak happens as the x-value for the annotation. I think I need to give it a string, but I'm not sure.
This doesn't work:
for spal in df_prod.columns:
maxvalue = df_prod[spal].max()
fig.add_annotation(
x = df_prod.index[df_prod[spal]==maxvalue], # <--- this ist the problem
y = wert,
text='peak ' + spal + ': ' + str(f'{round(wert): n}') + ' kW',
font={'size': 9} ,
showarrow=True,
arrowhead=3,
xanchor='left',
ax=20,
ay=5,
row=r,
col=c
)

