Wen i add a new value to the dataframe with aonother name. And ik want the other name to be in a new trace. Ik expect that new trace to show something in march but it shows tha data in january
data = [[βaβ, β2022-01-05β], [βaβ, β2022-02-14β], [βaβ, β2022-02-15β],[βaβ, β2022-05-14β],[βbβ, β2022-03-14β]]
dfa=df[df[βNameβ]==βaβ]
grouped_dfa=dfa.groupby([dfa.month, dfa.year]).count().reset_index()
dfb=df[df[βNameβ]==βbβ]
grouped_dfb=dfb.groupby([dfb.month, dfb.year]).count().reset_index()
trace1=go.Bar(
x = [grouped_df.month, grouped_df.year],
y = grouped_dfa.Name
)
trace2=go.Bar(
x = [grouped_df.month, grouped_df.year],
y = grouped_dfb.Name
)
You are using different dataframes for the x and y values. It should be:
trace1=go.Bar(
x = [grouped_dfa.month, grouped_dfa.year],
y = grouped_dfa.Name
)
trace2=go.Bar(
x = [grouped_dfb.month, grouped_dfb.year],
y = grouped_dfb.Name
)