I have a dropdown menu called gender with default value “ALL” for a chart. When the page loads, the page shows a chart with all aggregated data. After clicking a gender label, the chart updates accordingly. The problem is that it is not possible to go back to the “ALL” chart again. I would like to have the dropdown labels of “ALL” and individual genders but they don’t work together. The code also shows there is an error at the position of for loop and I have remove the “ALL” label to get rid of the error.
dcc.Dropdown(
id='gender-dropdown',
options=[
{'label': 'ALL', 'value': 'ALL'},
{'label': gender, 'value': gender }
for gender in df['gender'].unique()
],
value='ALL'
),