I'm trying to add my hline to the legend and label it as 'mean'. Is this possible and if so how.
Example
import numpy as np
import pandas as pd
import plotly.express as px
df = pd.DataFrame({'day': np.repeat(np.arange(1, 11, 1), 2),
'value': np.repeat([1, 2, 3, 4, 5], 4),
'var': list(['A', 'B']) * 10})
fig = px.bar(df,
x='day',
y='value',
color='var')
fig.add_hline(y=df['value'].mean(), line_dash="dot")
fig.show()