Bring Drag & Drop to Dash with Dashboard Engine. 💫 Learn how at our next webinar!

How can i write total number of each class to each bar?


Im making a dashboard and in 1 part i wanna make little change.

My bar plot format and graph same with this:

import as px
df =
fig =, x="sex", y="total_bill", color='time')

but as you see, every bar contains from summation of sum value. How can I see sum of total_bill s top of each bar?

Thanks in advance!!

1 Like

I did it like this.

1 Like

Hi @bilallozdemir,

You have to use barmode='group'

import as px
df =
fig =, x="sex", y="total_bill", color='time', barmode='group')

in general Plotly has a very good documentation with plenty of examples, where you often find answers you need. Maybe have a look there next time before you post here :wink:

Best, Alex -