how to push data into stack of morris bar chart, if come multiple similar month data from ajax call from different account this is my code:
DashboardService.getGraphForYear(year).success(function (data) {
$scope.count = data.results_count;
for(var j=0;j< $scope.count;j++)
{
$scope.month = data.results[j].month;
switch ($scope.month) {
case 1:
sales_com_year.push({month:month[1],amount:data.results[j].order_total_amount});
break;
case 2: sales_com_year.push({month:month[2],amount:data.results[j].order_total_amount});
break;
}
}
}).error(function (error) });
How to push data into if come January so all data push into as a stack into January as well for all month
sales_com_year.push({month:month[1],amount:data.results[j].order_total_amount});
month is not defined. – Inanimate