Struggling to customize an angular chart for my project. The x axis should display dates and the mouse over should show client names, all retrieved from an array of resource objects in a loop.
The loop code snippet is as follows:
angular.forEach(charts, function(chart, key) {
var d = new Date(chart.appointment_date).toDateString();
$scope.labels.push(d);
$scope.total_earnings += chart.cost.dollars;
$scope.data[0].push(chart.cost.dollars);
if (!chart.refundObj[0]){
$scope.data[1].push(0);
} else {
$scope.data[1].push((chart.refundObj[0].amount/100));
}
});
Currently, the date property is set on both the x axis and in the mouseover. However, when trying to include the client name using:
$scope.labels.push({date: d, name: clientName});
the output only shows [Object, Object].
Using this documentation as the foundation for the charts: