Reputation: 2449
I want to Send data to chart in the plotly offline mode like this example.(or refresh drew a diagram with new data without opening new tabs when I use plotly in a loop that open new tab for each iteration(like ajax refresh data). How can I do this task? thanks in advance for your helping.
Upvotes: 2
Views: 356
Reputation: 128
I'm a lot late with answer, but I guess someone would meet same problem some day.
Here you could find an example with an old Plotly v3
Here are a few threads for plotly v4 (new one, offline version):
I somehow rewrote those examples for up-to-date version:
fig = go.Figure(layout_title_text='my example chart')
fig = go.Figure(
data=[{'y': []}],
layout_title_text="Some layout title"
)
for iteration in range(10):
fig['data'][0]['y'] += tuple([iteration])
fig.write_html("somefile.html")
Upvotes: 1