Skip to content

Instantly share code, notes, and snippets.

@adamjanes
Last active March 17, 2018 08:34
Show Gist options
  • Save adamjanes/8b9520988d3d9794063d586cdc13e0df to your computer and use it in GitHub Desktop.
Save adamjanes/8b9520988d3d9794063d586cdc13e0df to your computer and use it in GitHub Desktop.
var flag = true;
// Run this code every second...
d3.interval(function(){
// Flick between our two data arrays
data = flag ? data0 : data1;
// Update our chart with new data
update(data);
// Update our flag variable
flag = !flag;
}, 1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment