I'm creating a chart with angular charts, and am having problems getting the chart how i need.
I would like the x axis to have the date and the mouse over to show the client name, which are all being fed from a loop on an array of resource object.
Here is the loop:
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));
}
});
And but this only sets the date property on the x axis, as well as in the mouse over. If i create an object using the following:
$scope.labels.push({date: d, name: clientName});
the result only says [Object, Object].
I'm using the following as the basis for the charts: