Skip to content

Instantly share code, notes, and snippets.

@frchaves
Created April 25, 2017 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frchaves/df26327006d1b2f56801487ac59408bb to your computer and use it in GitHub Desktop.
Save frchaves/df26327006d1b2f56801487ac59408bb to your computer and use it in GitHub Desktop.
global.data = [
{
x: "" ,
y: "" ,
'type':'scatter',
'mode':'lines+markers',
stream: {token: 'thetoken'}
}
];
var data = [
{
x: msg.x,
y: msg.y,
'type':'scatter',
'mode':'lines+markers',
stream: {token: 'thetoken'}
}
];
var i = 0;
global.data.push(x, data[i].y);
console.log(global.data);
output:
[ { x: '',
y: '',
type: 'scatter',
mode: 'lines+markers',
stream: { token: 'thetoken' } },
'2017-04-25 20:27:04.426',
3.4928,
'2017-04-25 20:27:06.147',
1.598,
'2017-04-25 20:27:07.992',
5.8,
'2017-04-25 20:27:10.457',
5.0345,
'2017-04-25 20:27:11.275',
3.09275 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment