Hi, Sorry about the double post, but this was also posted in Dash. I think I posted this should have been posted here.
Not sure if I need the plotly package or Cufflinks for this, but the examples that I have seen from both Dash and Plotly, it is not clear to me how to display groupy data as bar chart.
My code is as follows:
import pandas as pd
df = pd.read_excel(‘test.xlsx’,sheet_name=‘Sheet1’)
dfstate = df.groupby(‘State’)
df3 = dfstate.size()
my df3 data looks like this:
State
Done 3
Plot Phase 4
Script Phase 2
TRS Phase 2
TRS Review Phase 3
So I want to display the data above as a bar chart. So not sure how df3 in ‘data’ need to be presented in figure. Maybe I am overcomplicating this and the answer is right in front of me based on other examples.
dcc.Graph(id=‘plot1’,
figure = {
‘data’ : df3 , ‘layout’ : {
‘title’ : ‘TestState’,
‘xaxis’: {‘title’: ‘Review States’}, ‘yaxis’ :
{‘title’ : ‘Completion status’}
}}}