Hi,
I want to make a bar chart like this with n = number, and more space between the bar charts. How can I do this?
I have done this:
import pandas as pd
import plotly.graph_objs as go
df = pd.read_excel(r'C:\Users\amhd\Documents\TP\adrkvinnerogmenn.xlsx')
fig = go.Figure()
fig.add_trace(go.Bar(name='Deg', x=df['Tidsperiode'], y=df['Deg']*100, marker_color='#006F48'))
fig.add_trace(go.Bar(name='Senter', x=df['Tidsperiode'], y=df['Senter']*100, marker_color='#8CBDCE' ))
fig.add_trace(go.Bar(name='Nasjonalt', x=df['Tidsperiode'], y=df['Nasjonalt']*100, marker_color='#8F6861'))
fig.add_hline(y=45, line_dash="dot", line_color='red')
fig.update_layout(barmode='group', template='plotly_white', legend=dict(orientation='h', x=0.3),
title={
'text': "",
'y':1,
'x':0.5,
'xanchor': 'center',
'yanchor': 'top'})
fig.update_xaxes(type='category')
fig.update_yaxes(range=[0,70], ticksuffix="%")
fig.show()