Skip to content

Instantly share code, notes, and snippets.

@tqc
Created November 26, 2012 22:30
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 tqc/4151090 to your computer and use it in GitHub Desktop.
Save tqc/4151090 to your computer and use it in GitHub Desktop.
Generate random array for js graph
var min = -5;
var max = 10;
var dataset = [];
for (var i = 0; i < 60; i++) {
var newNumber = Math.random() * (max-min) + min;
dataset.push(newNumber);
}
​document.write(JSON.stringify(dataset));
​​​​
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment