Chart.JS using Angular.JS on JSFiddle

I’m trying to create a tested graph mimicking this chart from this documentation.

In my JSFiddle (

I tried adding all the links needed in the resources :


<canvas id="bar" class="chart chart-bar"
  chart-data="data" chart-labels="labels"> chart-series="series"


angular.module("app", ["chart.js"]).controller("BarCtrl", function ($scope) {
  $scope.labels = ['2006', '2007', '2008', '2009', '2010', '2011', '2012'];
  $scope.series = ['Series A', 'Series B'];

  $ = [
    [65, 59, 80, 81, 56, 55, 40],
    [28, 48, 40, 19, 86, 27, 90]


I see no errors in the console, but this white screen.

What did I do wrong to make my graph didn’t render?


Every angularJs app have to be mounted in the document using those directives: ng-app ng-controller
Your fiddle fixed:

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

$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 $ defined in the controller callback. chart-labels is bound with $scope.labels and so on…

Leave a Reply

Your email address will not be published. Required fields are marked *