Chart.JS using Angular.JS on JSFiddle

  angularjs, cdn, chart.js, javascript, jsfiddle

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

In my JSFiddle (https://jsfiddle.net/bheng/2pcmubwq/)

I tried adding all the links needed in the resources :

HTML

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

JS

angular.module("app", ["chart.js"]).controller("BarCtrl", 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]
  ];
});

Result

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

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

Source: AngularJS Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.