Dash Plotly bar chart shows only the first value of the first row of the filtered data frame

vd1 = vd.groupby(['Date','Country','City'])[['vendor_late_5_v2','vendor_late_10_v2',']].mean().reset_index()

DataFrame view after groupby

app = dash.Dash()

app.layout = html.Div([
html.Div([
    html.Div([
        html.H3('Select a Country'),
        dcc.Dropdown(id = 'drop',
options =[{'label': i, 'value': i} for i in vd1["Country"].unique()] + [{'label': 'Select all', 'value': 'All'}], 
value='All')
    ],style={'width': '30%','display':'inline-block'}),
    html.Div([
    html.H2('Select start and end dates:'),
    dcc.DatePickerRange(
        id='date_picker',
        min_date_allowed = vd1['Date'].min(),
        max_date_allowed = vd1['Date'].max(),
        start_date = vd1['Date'].min(),
        end_date = vd1['Date'].max(),
        #first_day_of_week=2,
        persistence=True,
        persistence_type='memory'     #'local', 'session', 'memory'
        )],style={'width': '30%','display':'inline-block','position':'relative'})
], className="row"),
html.Div([dcc.Graph(id = "graphc",style={'width': '70%','display':'inline-block'})],className="row")
 ],style={'width': '100%', 'display': 'inline-block'})

@app.callback(
Output('graphc', 'figure'),
[Input('drop', 'value'),
Input('date_picker', 'start_date'),
Input('date_picker', 'end_date')])
 
 
def update_graphc(country,start_date,end_date):
   if country == 'All':
       dff = vd1[(start_date <= vd1['Date']) & (end_date >= vd1['Date'])]
   else:
       dff = vd1[(vd1["Country"] == country) &
            (start_date <= vd1['Date']) & (end_date >= vd1['Date'])]

   data = go.Bar(x=dff["Country"].unique(),
                    y=dff["vendor_late_5_v2"],
                    name='vendor_late_5_v2')

   layout = go.Layout(title="VL > 5 & VL > 10 (V_2)")
   fig = go.Figure(data=data,layout=layout) 
   fig.update_xaxes(type='category')
   return fig

The Problem is the bar chart show only the first value of every country inside the data frame which should be aggregated to be the mean() of all not the first value of first line only, a small hint: i tried to wright the bar figure as the following but is useless: data = go.Bar(x=dff["Country"].unique(), y=dff["vendor_late_5_v2"].mean(), name='vendor_late_5_v2')

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum