hey everyone am trying to display a chart of a data that am getting it from an API
The Output of the API is List<String> not Json ;
here's my js file
google.load('visualization', '1', {
packages: ['corechart']
});
app.controller("chartController",function($scope,$http)
{
$http.get("/idcountcisco")
.success(function(data){
$scope.cisco=data
console.log($scope.cisco)
})
$http.get("/idcountlog4j")
.success(function(data){
$scope.log4j=data
console.log($scope.log4j)
})
$http.get("/idcountwin")
.success(function(data){
$scope.windows=data
console.log($scope.windows)
})
if (($scope.cisco=!undefined )&&($scope.log4j=!undefined )&&($scope.windows=!undefined ))
{
var data = google.visualization.arrayToDataTable([
['type', 'Qs' ],
['cisco', $scope.cisco],
['lo4j',$scope.log4j ],
['windows',$scope.windows],
]);
var options = {
title: 'Statistiques'
};
var chart = new google.visualization.PieChart(document.getElementById('chartdiv'));
chart.draw(data, options);
}
});
okey so in console.log am getting this
$scope.cisco=18
$scope.log4j=45
$scope.windows=15
and am having a chart like this , it's like it's not getting the real value when i tried to understand it after the if all my vars value become equal to true
thanks for any help
