I'm doing some graphics with the Angular chart js library, I've tried with the examples I found on the page and it works correctly but when I try to make two graphics on the same page I get the following mistake
Error: [ng:areq] http://errors.angularjs.org/1.5.8/ng/areq?p0=BarCtrl&p1=not%20a%20function%2C%20got%20undefined
Here is my code HTML:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Barra</title>
<link href="bootstrap.css" rel="stylesheet">
</head>
<body">
<div ng-app="app">
<div id="container" class="container">
<div class="row" ng-controller="BarCtrl">
<div class="col-lg-6 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">Barra</div>
<div class="panel-body">
<canvas id="base" class="chart chart-bar"
chart-data="data" chart-labels="labels" chart-series="series">
</canvas>
</div>
</div>
</div>
</div>
</div>
</div>
<div ng-app="app1">
<div id="container" class="container">
<div class="row" ng-controller="BarCtrl">
<div class="col-lg-6 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">Barra1</div>
<div class="panel-body">
<canvas id="base" class="chart chart-bar"
chart-data="data" chart-labels="labels" chart-series="series">
</canvas>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="angular/angular.min.js"></script>
<script src="angular/Chart.min.js"></script>
<script src="angular/angular-chart.min.js"></script>
<script src="angular/angular-chart.js"></script>
<script src="barra.js"></script>
</body>
</html>
and this is the Js:
angular.module("app", ["chart.js"]).controller("BarCtrl", function ($scope) { $scope.labels = ['2006', '2007', '2008', '2009', '2010', '2011', '2012']; $scope.series = ['Series A']; $scope.data = [
[65, 59, 80, 81, 56, 55, 40]]; });
angular.module("app1", ["chart.js"]).controller("BarCtrl", function ($scope {$scope.labels = ['2006', '2007', '2008', '2009', '2010', '2011', '2012']; $scope.series = ['Series A']; $scope.data = [
[65, 59, 80, 81, 56, 55, 40]]; });
Are data only test why are they the same, who believe that it can fail for me to be leaving this error?