Hello, I want to display my data using plotly. Here is a example of my dataset:
id,expNumber,attempt,finished,successful,
1,1,1,true,false,
1,1,2,false,false,
1,1,3,true,true,
1,2,1,false,false,
1,2,2,true,false,
1,2,3,true,true,
1,4,1,false,false,
1,4,2,false,false,
What I want to do is to display the sum of true/false per expNumber in a bar chart. Here is a little mockup:
I use the following Code but it doesnt work (It is just a snippet). I just get the sum of all expNumber per True / False. Do you know how I can modify x and y axis to get a result like the mockup?
if "expNumber" in dff:
return [
dcc.Graph(id='bar-chart',
figure=px.bar(
data_frame=dff,
x="successful",
y="expNumber",
labels={"": ""}
).update_layout(showlegend=False, xaxis={'categoryorder': 'total ascending'})
.update_traces(hovertemplate="<b>%{y}%</b><extra></extra>")
)
]