After following the instructions provided on the website Angular chart JS, I encountered an issue with creating a bar graph from the data.
The code in my dashboard.html file looks like this:
<div class="md-padding" flex layout-sm="column" >
<md-card class="text-center">
<md-card-content>
<canvas id="bar" class="chart chart-bar" ng-controller="DashboardCtrl" chart-data="data" chart-labels="labels" chart-series="series">
</canvas>
</md-card-content>
</md-card>
</div>
And here is the content of my dashboardctrl.js file:
(function () {
'use strict';
angular.module("home", ["chart.js"])
.config(['ChartJsProvider', function (ChartJsProvider) {
ChartJsProvider.setOptions({
chartColors: ['#FF5252', '#FF8A80'],
responsive: false
});
// Configure all line charts
ChartJsProvider.setOptions('line', {
datasetFill: false
});
}])
.controller("DashboardCtrl", ['$scope', function ($scope) {
$scope.labels = ['2006', '2007', '2008', '2009', '2010', '2011', '2012'];
$scope.series = ['Series A', 'Series B'];
$scope.data = [
[65, 59, 80, 81, 56, 55, 40],
[28, 48, 40, 19, 86, 27, 90]
];
console.log("done");
}]);
})();
I'm currently encountering an error:
Multiple directives [ngController, chartBar] asking for new/isolated scope on:`
Your assistance on this matter would be greatly appreciated. Thank you in advance. `