I'm trying to insert a JSON-formatted HTTP URL into the data.push() function in my code. Currently, I am populating it with random math array values. How can I properly push this JSON URL:
http://maricoih.e21designs.com/services/productionhourlyscopra
into the data.push() function in the following AngularJS controller:
app.controller('MainCtrl', ['$scope',
function($scope) {
$scope.tasksRunData = [{
label:"ope",
data: []
},{
label:"lma",
data: []
},{
label:"lmb",
data: []
}];
$scope.tasksRunChartOptions = {
legend: {
show: true
},
lines: {
show: true
}
};
// some data
for (var i = 1; i < 100; i += 1) {
$scope.tasksRunData[0].data.push([i, Math.random(i) * 100]);
}
for (var i = 1; i < 100; i += 1) {
$scope.tasksRunData[1].data.push([i, Math.random(i) * 45]);
}
for (var i = 1; i < 100; i += 1) {
$scope.tasksRunData[2].data.push([i, Math.random(i) * 65]);
}
$scope.reportTasksRunRange = {
min: 1,
max: 100,
floor: 1,
ceil: 100,
step: 1
};
}
]);
You can view the complete code by visiting the plunkr link.