Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/431.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 当我试图在页面上放置highcharts div时,会导致错误_Javascript_Jquery_Json_Angularjs_Highcharts - Fatal编程技术网

Javascript 当我试图在页面上放置highcharts div时,会导致错误

Javascript 当我试图在页面上放置highcharts div时,会导致错误,javascript,jquery,json,angularjs,highcharts,Javascript,Jquery,Json,Angularjs,Highcharts,我有一个控制器,看起来像这样 function ChartController($scope, $location, Chart) { $scope.$on('$locationChangeSuccess', function(event) { var c = Chart.get({chart_name: $location.hash()}, function(data) { $scope.chart = data; });

我有一个控制器,看起来像这样

function ChartController($scope, $location, Chart) {
    $scope.$on('$locationChangeSuccess', function(event) {
        var c = Chart.get({chart_name: $location.hash()}, function(data) {
            $scope.chart = data;
        });
    });
}
这显示了预期的json。我检查
typeofdata
,它按预期返回一个对象,但当我尝试进行div并将其放在页面上时,它会给我一个错误

function ChartController($scope, $location, Chart) {
    $scope.$on('$locationChangeSuccess', function(event) {
        var c = Chart.get({chart_name: $location.hash()}, function(data) {
            var chart = $('<div/>').highcharts(data);
            $scope.chart = chart;
        });
    });
}

为什么会触发此错误?

json的外观如何?
TypeError: Converting circular structure to JSON
    at Object.stringify (native)
    at toJson (http://127.0.0.1:5000/pmstats/static/lib/angular/angular.js:762:15)
    at Object.$get.fn (http://127.0.0.1:5000/pmstats/static/lib/angular/angular.js:4981:24)
    at Object.$get.Scope.$digest (http://127.0.0.1:5000/pmstats/static/lib/angular/angular.js:7935:38)
    at Object.$get.Scope.$apply (http://127.0.0.1:5000/pmstats/static/lib/angular/angular.js:8143:24)
    at done (http://127.0.0.1:5000/pmstats/static/lib/angular/angular.js:9170:20)
    at completeRequest (http://127.0.0.1:5000/pmstats/static/lib/angular/angular.js:9333:7)
    at XMLHttpRequest.xhr.onreadystatechange (http://127.0.0.1:5000/pmstats/static/lib/angular/angular.js:9303:11) angular.js:5754
(anonymous function) angular.js:5754
$get angular.js:4846
$get.Scope.$digest angular.js:7954
$get.Scope.$apply angular.js:8143
done angular.js:9170
completeRequest angular.js:9333
xhr.onreadystatechange