I'm scraping prices data from a website and save them to a CSV file
I'm using "plotly.graph_objects" to draw the chart after I finish the scraping and it's work fine, but what I want to do is to automatically update the chart every time a new row added to the CSV file without waiting until all the work finish to draw it.
this is my code
import plotly.graph_objects as go
import pandas as pd
df = pd.read_csv("30122019-062734.csv")
fig = go.Figure()
fig.add_trace(go.Scatter(
x=df.Date,
y=df['MACD'],
name="MACD",
line_color='blue',
opacity=0.8))
fig.add_trace(go.Scatter(
x=df.Date,
y=df['SIGNAL'],
name="Signal",
line_color='red',
opacity=0.8))
fig.update_layout(
title="Plot Title",
font=dict(
family="Courier New, monospace",
size=18,
color="#7f7f7f"))
fig.show()
and this a review
is there a way to make it automatically updated every time a new row added?