Chartjs-Chart.JS using Angular.JS on JSFiddle

2👍

Every angularJs app have to be mounted in the document using those directives: ng-app ng-controller
Your fiddle fixed: https://jsfiddle.net/nmwypgdq/9/

<div ng-app="app" ng-controller="BarCtrl">
  <canvas id="bar" class="chart chart-bar" chart-data="data" chart-labels="labels" chart-series="series"></canvas>
</div>

$scope object passed by controller callback is available in your template. You can reference its properties and methods in the template. Thus chart-data="data" binds HTML element property chart-data with $scope.data defined in the controller callback. chart-labels is bound with $scope.labels and so on…

Leave a comment