title: TypeError: Cannot read property 'datasets' of undefined - Angular Chart
body: <p>I am trying to show a chart using angular chart. But I'm get the following error:</p>
  
  <p>TypeError: Cannot read property 'datasets' of undefined
      at Object.i.Type.extend.initialize (<a href="http://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.1-beta.2/Chart.min.js:9:27506" rel="nofollow">http://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.1-beta.2/Chart.min.js:9:27506</a>)
      at Object.e.Type (<a href="http://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.1-beta.2/Chart.min.js:9:9713" rel="nofollow">http://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.1-beta.2/Chart.min.js:9:9713</a>)
      at Object.s (<a href="http://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.1-beta.2/Chart.min.js:9:12974" rel="nofollow">http://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.1-beta.2/Chart.min.js:9:12974</a>)
      at e.(anonymous function) [as Bar] (<a href="http://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.1-beta.2/Chart.min.js:9:13316" rel="nofollow">http://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.1-beta.2/Chart.min.js:9:13316</a>)</p>
  
  <p>My code:</p>
  
  <pre><code>app.controller('graphController', ['$scope', '$kinvey','$location', function($scope, $kinvey, $location) {
  $scope.popula = function(){ 
    var query = new $kinvey.Query();   
    query.equalTo('idColetor', 659238569);                          
    query.descending('tsmilliseconds').limit(7);
    var promise = $kinvey.DataStore.find('dataBase', query); 
    promise.then(function(response) {   
    arrayVelocidade = [];
    for(var j = response.length - 1; j &gt;= 0 ; j--) {          
        arrayVelocidade.push(response[j].veloc);    
      }
    drawLineChart(arrayVelocidade);
  
  
  });
  };
  
  
  function drawLineChart(arrayVelocidade){
  
    $scope.lineChartData = {
        labels: ["30", "25", "20", "15", "10", "05", "0"],
        datasets: [
        {
          label: "Velocidade",
          fillColor: "rgba(220,220,220,0.2)",
          strokeColor: "rgba(220,220,220,1)",
          pointColor: "rgba(220,220,220,1)",
          pointStrokeColor: "#fff",
          pointHighlightFill: "#fff",
          pointHighlightStroke: "rgba(220,220,220,1)",
          data: arrayVelocidade
        }
        ]
      };
      $scope.activeData = $scope.lineChartData;
  }
  
  
  
  }
  ]);
  </code></pre>
  
  <p>In the index page I called:</p>
  
  
  
  <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-route.js"&gt;&lt;/script&gt;
  &lt;script src="http://da189i1jfloii.cloudfront.net/js/kinvey-angular-1.5.1.min.js"&gt;&lt;/script&gt; 
  &lt;script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.1-beta.2/Chart.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="dist/angular-chartjs.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/jquery.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Any information would help. thanks !</p>