Skip to content

Instantly share code, notes, and snippets.

@infantiablue
Last active April 28, 2021 10:09
Show Gist options
  • Save infantiablue/797de0d38e9d2ff567de6feba361aef0 to your computer and use it in GitHub Desktop.
Save infantiablue/797de0d38e9d2ff567de6feba361aef0 to your computer and use it in GitHub Desktop.
const updateChart = (data) => {
let trace_price = {
x: [data.index.map((t) => new Date(t))],
y: [data.price],
};
let trace_volumes = {
x: [data.index.map((t) => new Date(t))],
y: [data.volumes],
};
Plotly.update("chart", trace_price, {}, 0);
Plotly.update("chart", trace_volumes, {}, 1);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment