Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/393.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 使用ajax为highcharts添加自定义参数_Javascript_Php_Jquery_Ajax_Highcharts - Fatal编程技术网

Javascript 使用ajax为highcharts添加自定义参数

Javascript 使用ajax为highcharts添加自定义参数,javascript,php,jquery,ajax,highcharts,Javascript,Php,Jquery,Ajax,Highcharts,我正在尝试向我的highcharts中添加一些参数,这些参数由ajax调用。我在一个单独的php中调用所有必要的参数,然后成功的结果将把它放入highcharts的容器中 我的代码: $.ajax({ type: 'post', url: 'sdayresult.php', data: $("#FormName").serialize(), success: function(data) { //$("#anser").htm

我正在尝试向我的highcharts中添加一些参数,这些参数由ajax调用。我在一个单独的php中调用所有必要的参数,然后成功的结果将把它放入highcharts的容器中

我的代码:

 $.ajax({
      type: 'post',
      url: 'sdayresult.php',
      data: $("#FormName").serialize(),
      success: function(data) {    
      //$("#anser").html(data);
      $('#container').highcharts({data});
       }
数据的价值:

 chart: {
            type: 'scatter'
        },
        title: {
            text: 'Search by Airline'
        },
        xAxis: {
            categories: ['none']
        },
        yAxis: {
            title: {
                text: '# of Crew'
            }
        },
        series: [{
            name: '# of Crew',
            URLs: ['#'],
            data: [0],
           point: {
                events: {
                  click: function() {
                  var someURL = this.series.userOptions.URLs[this.x]; // onclick get the x index and use it to find the URL
                  if (someURL)
                   window.open('http://'+someURL);
                }}}         
        }]

但是当我运行脚本时,出现了一个javascript错误,表示我有一个未定义的“}”。我尝试将数据的值粘贴到highcharts的另一个测试页面上,看起来数据的值是正确的。我应该怎么做才能修复它?

您是否包含了所有必需的highcharts js库…?如果您有额外的
}
请删除它。你刚才在JS中有错误,仅此而已。