I am working on plotly (python) to plot a horizontal bar chart like the below figure.
import plotly.express as px
fig = px.bar(
x=prices,
y=['Average $' + str(round(avg_price, 2)), 'Lowest $' +
str(round(min_price, 2)), 'Last $' + str(round(last_price, 2)),
'Proposed $' + str(round(proposed_price, 2))],
color=['Last', 'Average', 'Lowest', 'Proposed'],
text=delta,
orientation='h',
height=400,
)
fig.add_vline(x=spend[-1], line_width=2, line_dash="dash",
line_color="red")
fig.add_vline(x=max(spend), line_width=2, line_dash="dash",
line_color="green")
fig.update_traces( textposition='outside')
fig.update_layout(
title="Saving/Loss diagram",
xaxis_title="",
yaxis_title="",
legend_title="Vendor names",
width=1000,
)
fig.show()
In this figure I display text only outside of each bar chart. But now I am going to display another text inside each bar chart. How can I do that in plotly (python)?



