Trying to implement new rounded bar corners

Hi guys,

I wanted to try the newly introduced rounded bar corners but cant implement it when plotting stacked bar graphs. Here is the code:

fig = go.Figure()

fig.add_traces(go.Bar(x=ver_1['LapNumber'],y=['Verstappen'],orientation='h',marker_color='#da291c',name='S',text=ver_1['LapNumber']))
fig.add_traces(go.Bar(x=ver_2['LapNumber'],y=['Verstappen'],orientation='h',marker_color='#ffd12e',name='M',text=ver_2['LapNumber']))
fig.add_traces(go.Bar(x=ver_3['LapNumber'],y=['Verstappen'],orientation='h',marker_color='#da291c',showlegend=False,text=ver_3['LapNumber']))

fig.update_layout(title='Tyre Strategies: 2024 Spanish Grand Prix',barmode='stack',height=500,template='plotly_dark')
fig.show()

Any ideas on how to implement it on the stacked bar graphs?

Thanks in advance

As shown in the reference, the corners of the bar graph need to be set.

fig.update_layout(title='Tyre Strategies: 2024 Spanish Grand Prix',
                  barmode='stack',
                  height=500,
                  template='plotly_dark',
                  barcornerradius=15
                 )

When I try this only the last trace of stacked bar graph is rounded as seen in this picture.

I want every trace of the stacked bar graph to be rounded.

1 Like

As a feature at this time, it does not support all tracing, and only the tip seems to be rounded.

Thought so. Anyways, thank you very much for taking the time out to help me. This community rocks

I actually figured something out recently. It’s a bit out of the way, but you can make the graph with rounded edges that you are looking for, you just need to add a base attribute to your data. The problem with this is that you’ll have to manually change the base to match up with how the stacking works normally. Here is my example that I made in plotly (with js).