Bar Graph Not showing up after callback

Hello Everyone ,
This is the code I have written for the graph in my app layout :

                            dbc.Container([
                                dcc.Graph(figure='last7days_allotment',
                                          )
                            ])

Now in the callback my code is :

@app.callback(
    Output('last7days_allotment', 'figure'),
    Input('url', 'pathname'),
    # State('my-date-picker-single', 'date')
    prevent_initial_call=False,
)
def func(date):
    # today_date = date.today()
    data = seven_allotment()
    data1 = data.groupby(['allotment_date'])['cycleid'].nunique().reset_index()
    graph = px.bar(data_frame=data1, x="allotment_date", y="cycleid", color="allotment_date",
                   text="cycleid")
    return graph

But their is nothing that pops up in the page , the bar graph is not there. Is there any suggesstions to what I can do ?

Hi @Lucifer ,

You have to give the graph the id='last7days_allotment'

Also make sure that you input the correct argument into your function, right now it’s the pathname of the component url.