Last active
August 29, 2015 13:57
-
-
Save getflourish/9528344 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.generateData = function(n) { | |
var fakeData = {"keys":[], "values":[]}; | |
var months = [ | |
"Jan", | |
"Feb", | |
"Mar", | |
"Apr", | |
"May", | |
"Jun", | |
"Jul", | |
"Aug", | |
"Sep", | |
"Oct", | |
"Nov", | |
"Dec" | |
] | |
var year = 14; | |
for (var i = 0; i < n; i++) { | |
if (i % 12 == 0) { | |
year++; | |
ms = 0; | |
} else { | |
ms++; | |
} | |
var data = { | |
"Date": months[ms] + "-" + year, | |
} | |
fakeData.values.push(data); | |
} | |
// push keys | |
for(var k in fakeData.values[0]) fakeData.keys.push(k); | |
return fakeData; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment