Skip to content

Instantly share code, notes, and snippets.

@chirag773
Created January 31, 2020 09:14
Show Gist options
  • Save chirag773/0f97418bb99463c583cabf2760fc0365 to your computer and use it in GitHub Desktop.
Save chirag773/0f97418bb99463c583cabf2760fc0365 to your computer and use it in GitHub Desktop.
LGEyyY
<div id="plotDiv"></div>
var plotDiv = document.getElementById('plotDiv');
var data = [{
x: [ new Date().getTime() / 1000 ],
y: [0]
}];
Plotly.plot(plotDiv, data, { title: 'Random Over Time'});
setInterval(function(){
var update = {
x: [[ new Date().getTime() / 1000 ]],
y: [[ Math.random() ]]
};
Plotly.extendTraces(plotDiv, update, [0], 10);
}, 1000);
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment