I’m creating input boxes base on the user’s choice.
@app.callback(
[Output('Symbol', 'children'),Output('Date', 'children')],
[Input('Update_Button', 'n_clicks')],
[State('Number_of_Event', 'value')])
def numberchoose(n_clicks, num):
if n_clicks:
global store
store = num
return ([dcc.Input(type='text', id='symbol%i' % i)for i in range(num)],
[dcc.Input(type = 'Date', id = 'date%i' % i) for i in range(num)])
And then use the created inputs’ value for another callback to generate plots
@app.callback(
Output('AR', 'figure'),
[Input('Submit_Button', 'n_clicks')],
[State('symbol%i' % i, 'value') for i in range(store),
State('date%i' % i, 'value') for i in range(store)])
def arplot(n_clicks, ?, ?):
Here is where I got stuck since I don’t know the number user would choose, what should I put in the argument. In fact, I’m not sure if the for loop would work in State.
I attached a screenshot of what the current page looks like.
Thank you