Skip to content

Instantly share code, notes, and snippets.

@etoxin
Created October 10, 2016 01:07
Show Gist options
  • Save etoxin/7fd9cf3d1e22798677e3e0bc8b99ec65 to your computer and use it in GitHub Desktop.
Save etoxin/7fd9cf3d1e22798677e3e0bc8b99ec65 to your computer and use it in GitHub Desktop.
JSON Charts Creator
// JSON Chart Data Maker
var points = [];
var days = 31;
var months = 12;
for (var x = 1; x < months; x++) {
for (var i = 1; i < days; i++) {
var day = i < 10 ? "0" + i : i;
var month = x < 10 ? "0" + x : x;
points.push({
"X": "2015-"+month+"-"+day+"T00:00:00",
"Y": _.random(350,450)
});
}
}
console.log(JSON.stringify(points));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment