I'm having problems getting a simple chart to work using angular.
I have chart JS set up using "angular-chartjs-directive": "^1.0.0" within my bower. This gets injected correctly based on the source of my file.
I then have this as my controller:
export class MainController {
constructor ($scope) {
'ngInject';
this.createGraph($scope);
}
createGraph($scope) {
var vm = this;
vm.messages = [{msg: "hello"}];
var data = {
labels : ["January","February","March","April","May","June","July"],
datasets : [
{
fillColor : "rgba(220,220,220,0.5)",
strokeColor : "rgba(220,220,220,1)",
pointColor : "rgba(220,220,220,1)",
pointStrokeColor : "#fff",
data : [65,59,90,81,56,55,40]
},
{
fillColor : "rgba(151,187,205,0.5)",
strokeColor : "rgba(151,187,205,1)",
pointColor : "rgba(151,187,205,1)",
pointStrokeColor : "#fff",
data : [28,48,40,19,96,27,100]
}
]
}
$scope.myChart = data;
}
}
And this in my main html:
<div class="container">
<chart value="myChart"></chart>
</div>
But I get the error:
TypeError: chart[chartType] is not a function
Any ideas?