Hi
I’m trying to reset the graph to the original state but this doesn’t work.
external_stylesheets = [‘https://codepen.io/chriddyp/pen/bWLwgP.css’]
app = dash.Dash(name, external_stylesheets=external_stylesheets)
app.layout = html.Div([
html.Div(["Input: ",
dcc.Input(id=‘my-input’, value=‘initial value’, type=‘text’)]),
html.Br(),
html.Div(id='my-output'),
html.Button("Submit", id="submit-button", n_clicks=0),
dcc.Graph(id="output-graph"),
]),
html.Div([
html.Button(id='submit-button3',
children='Reset')
]),
])
@app.callback(
Output(component_id=‘output-graph’, component_property=‘figure’),
[Input(component_id=‘submit-button’, component_property=‘n_clicks’)],
[dash.dependencies.State(component_id=“my-input”, component_property=“value”)]
)
def update_output_div(n_clicks, value):
# selected_stock=value
df= pd.read_csv(’’)
dfa = df[(df[‘Sl’]==value)]
fig = px.line(dfa, x=‘Date’, y=‘Close’, labels=dict(x=“Date”, y=“US:OCGN $”))
return fig
@app.callback(Output(‘submit-button’,‘n_clicks’),
[Input(‘submit-button3’,‘n_clicks’)])
def update3(reset):
return 0
if name == ‘main’:
app.run_server(debug=False)