Javascript 角度nvd3 piechart不从后端渲染数据

Javascript 角度nvd3 piechart不从后端渲染数据,javascript,angularjs,d3.js,nvd3.js,Javascript,Angularjs,D3.js,Nvd3.js,我使用angulard3指令从后端数据呈现饼图。 饼图适用于静态数据: $http({ method : 'GET', url : piechart_url, headers:{ 'Content-Type' :'application/json' }}) .success(function(resp,status,headers,config) { //try hard coded here $scope.exampleData = [

我使用angulard3指令从后端数据呈现饼图。 饼图适用于静态数据:

$http({
    method : 'GET',
    url : piechart_url,
    headers:{
    'Content-Type' :'application/json'
}})
.success(function(resp,status,headers,config) {
    //try hard coded here
    $scope.exampleData = [
           { key: "One", y: 5 },
           { key: "Two", y: 2 },
           { key: "Seven", y: 9 }
    ];
})
但它不能处理来自后端API的数据。 *它仅呈现饼图中的第一个关键点*

$http({
   method : 'GET',
   url : piechart_url,
   headers:{
     'Content-Type' :'application/json'
   }})
   .success(function(resp,status,headers,config) {
      $scope.exampleData = resp.items;
   })
响应项包含

   [{"key":"ONE","y":10000},{"key":"TWO","y":10}]

我尝试过添加/删除引号。

您是否查看过开发人员控制台中的错误?也许你可以提供一个打捞器。