In the code below, i have a dataframe with 4 columns ('data', 'valor', 'nome', and 'total'). The variable 'text' sets the column 'nome' as a label. Now i need to do the same with the column 'total', i need to set the column 'total' as a label too. But i can't figure out how.
def bar_detalhado(dframe):
import plotly.express as px
import plotly
df = dframe
fig = px.bar(df, x="data", y="valor", text="nome",
color='tipo', barmode='group',
height=400)
fig.show()
Something like ... :
def bar_detalhado(dframe):
import plotly.express as px
import plotly
df = dframe
fig = px.bar(df, x="data", y="valor", text="nome", text2="total",
color='tipo', barmode='group',
height=400)
fig.show()