D
D
Danil Samodurov2020-09-07 19:16:15
Python
Danil Samodurov, 2020-09-07 19:16:15

How to make a time chart update in Dash?

I need to build an updatable chart in the Dash framework.
Approximate code looks like this:

import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import plotly.graph_objs as go

app = dash.Dash()

df = pd.read_csv('BD/Ticker.csv')
fig = go.Figure([go.Scatter(x=df['time'], y=df['Volume'])])

app.layout = html.Div([
        dcc.Graph(figure=fig)
])

if __name__ == "__main__":
    app.run_server(debug=True)

The problem is that the Ticker.csv file is constantly being updated by another script. I would like to see this change on a graph.
How can I do that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-09-08
@samodurOFF

https://dash.plotly.com/live-updates

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question