Hi Everyone,
So, I have a problem because I want to create a graph that will update automatically when I select different data frame from the checklist.
my graph looks like that:
figure={'data': [
go.Scatter(
x=df.index,
y=df[0],
line=dict(color='#ae5a41'),
opacity=0.8),
go.Scatter(
x=df.index,
y=df[1],
line=dict(color='#5a5255'),
opacity=0.8),
go.Scatter(
x=df.index,
y=df[2],
line=dict(color='#1b85b8'),
opacity=0.8),
go.Scatter(
x=df.index,
y=df[3],
line=dict(color='#c3cb71'),
opacity=0.8),
go.Scatter(
x=df.index,
y=df[4],
line=dict(color='#559e83'),
opacity=0.8)
],
'layout': go.Layout(title='',
xaxis=dict(
rangeselector=dict(
buttons=list([
dict(count=1, label='1 day', step='day', stepmode='backward'),
dict(count=7, label='1 week', step='day', stepmode='backward'),
dict(count=1, label='1 month', step='month', stepmode='backward'),
dict(count=3, label='3 months', step='month', stepmode='backward'),
dict(count=6, label='6 months', step='month', stepmode='backward'),
dict(step='all')
])
),
rangeslider=dict(), type='date'
)
)}, style={'width': '100%', 'display': 'inline-block'}),
dcc.Markdown(''' --- '''),
])
my checlist:
dcc.Checklist(id='account_options',
options=[
{'label': 'Free Accounts', 'value': 'free'},
{'label': 'Paid Accounts', 'value': 'pro'},
{'label': 'All Accounts', 'value': 'all'}
],
values=['all'])
], style={'display': 'inline-block', 'verticalAlign': 'top', 'width': '30%'}),
could you please help me out how to change that graph to be "dynamic"
I have read some answer already, but nothing that suits my problem.
[https://community.plotly.com/t/graphs-are-not-automatically-updated-after-dropdown-value-selection-when-animate-true/4644/7](https://community.plotly.com/t/graphs-are-not-automatically-updated-after-dropdown-value-selection-when-animate-true/4644/7)
or
[https://plot.ly/dash/getting-started-part-2](https://plot.ly/dash/getting-started-part-2)
Thank you everyone for help.