I was wondering whether it is possible to stop Plotly.extendTraces and keep the graphs intact with the last streamed data on the graphs? I am streaming data from a python server at the moment, and I want a way to stop data from being plotted on the streaming graph by a button click.
Code:
plotGraph('Dashboard', data, layout);
var cnt = 0;
var interval = setInterval(function () {
var update = {
x: [
[time],
[time],
[time],
[time],
[time],
[time],
],
y: [
[incoming[3]],
[incoming[12]],
[incoming[6]],
[incoming[10]],
[incoming[1]],
[incoming[8]],
]
}
Plotly.extendTraces('Dashboard', update, [0, 1, 2, 3, 4, 5], 100);
Plotly.relayout('Dashboard', 'xaxis.autorange', true);
if (cnt === 100) clearInterval(interval);
}, 50);