3

I am trying to make the vertical bars rounded from the top side but I am not able to figure out which attribute suits this. I found out on Github that this feature has not been yet implemented. So is there any other way to achieve the same?

Bar Chart
Bar Chart

df = pd.DataFrame({
    "Day": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday","Sunday"],
    "Amount": [4, 1, 2, 2, 4, 5,8],
})

fig = px.bar(df, x="Day", y="Amount",
             orientation="v",
             opacity=0.9,
             barmode='relative',
             color_discrete_sequence=["purple"],
             text='Amount',
             hover_data=None,
             template='none')
fig.update_layout({
'plot_bgcolor': 'rgba(0, 0, 0, 0)',
'paper_bgcolor': 'rgba(0, 0, 0, 0)',
})

fig.update_traces(texttemplate='%{text:.2s}',
                  hovertemplate=None,
                  hoverinfo='none',
                  textposition='outside',
                  width = [.1,.1,.1,.1,.1,.1,.1]
                 )

fig.update_layout(yaxis=dict(range=[0,10]))
dcc.Graph(

    id='graph-4',
    figure=fig
),
Vitalizzare
  • 4,496
  • 7
  • 13
  • 32

0 Answers0