The docs indicate you can't specify more than one column, but you can pass a list of strings.
Here's a self-contained little example that uses df.itertuples
in a list comprehension to create a string of text for each bar.
import plotly.express as px
import pandas as pd
df = pd.DataFrame(dict(data=[1, 2, 3], valor=[5, 6, 7], nome=[8, 9, 10]))
df['total'] = df.sum(axis=1)
df
def bar_detalhado(dframe):
fig = px.bar(
dframe,
x="data",
y="valor",
text=[f"n={row[2]} v={row[1]} t={row[3]}" for row in df.itertuples()],
)
fig.show()
bar_detalhado(df)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…