0👍
I figured it out already. Let me know if I did it right. But the chart gets values from my database.
$scope.status = ["Approved", "Pending"];
$scope.stats = ["Stats"];
var query = "SELECT sum(members.status='P') as pending, "
+ "sum(members.status='A') as approved FROM members";
$cordovaSQLite.execute(db, query, [])
.then(function(res){
$scope.memStatData= res.rows.item(0);
var p = $scope.memStatData.pending;
var a = $scope.memStatData.approved;
console.log(p);
console.log(a);
$scope.memStatData = [
[p, a]
];
}, function(err){
// $cordovaToast.showShortBottom('Something Went Wrong').then(function(success){}, function(err){});
console.log(err.message);
});
- Chartjs-Using ticks 'major' with Chart.js is overlapping with an unknown text
- Chartjs-How to use data from database for chart.js (bubble chart) with Ajax/JSON method?
Source:stackexchange.com