✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

Encountered the problem of adding colors

Hello colleagues!
encountered the problem of adding colors
in general, I have a dropdown menu in which the categories are
when I choose a category
it is added to the schedule
how can I set a color for the selected category?
Here is a part of my when:

dcc.Dropdown(
id=‘country-dropdown1’,
options=[{‘label’: i, ‘value’: i} for i in df.CATEGORY_SHORT_NAME.unique()],
multi=True,
value=df.CATEGORY_SHORT_NAME.unique()
),

@app.callback(
dash.dependencies.Output(‘timeseries-graph’, ‘figure’),
[dash.dependencies.Input(‘country-dropdown1’, ‘value’)])
def update_graph(country_values):
dff = df.loc[df[‘CATEGORY_SHORT_NAME’].isin(country_values)]
return {
‘data’: [go.Bar(
x=dff[dff[‘BANNER_SHORT_NAME’] == i][‘Ls’],
y=dff[dff[‘BANNER_SHORT_NAME’] == i][‘CATEGORY_SHORT_NAME’],
orientation=‘h’,
name=i,
marker={
‘opacity’: 0.5,
}
)for i in dff.BANNER_SHORT_NAME.unique()],
‘layout’: go.Layout(
barmode=‘stack’,
)
}