Highcharts SCRIPT1007:应为']'错误

Highcharts SCRIPT1007:应为']'错误,highcharts,Highcharts,我在显示海图时出错。错误为:SCRIPT1007:第47行第4个字符处应为']'。几个小时以来一直在按我的头,试图解决问题,但没有运气:。非常感谢您的帮助。提前谢谢。詹姆斯 ==== Class === public class HighChartsController3 { public String[] total; public String[] gettotal() { String q = 'SELECT count(Id),Name Total FROM

我在显示海图时出错。错误为:SCRIPT1007:第47行第4个字符处应为']'。几个小时以来一直在按我的头,试图解决问题,但没有运气:。非常感谢您的帮助。提前谢谢。詹姆斯

   ==== Class ===

public class HighChartsController3
{
  public String[] total;
  public String[] gettotal()
  {
     String q = 'SELECT count(Id),Name Total FROM Account group by Name';
     AggregateResult[] agr =Database.query(q);
     String[] strarray = new String[agr.size()];
     for (AggregateResult ar : agr)  
     {
         strarray.add(String.valueof(ar.get('Total')));

     }             

     return strarray ;
   } 


 public String[] position;
 public String[] getposition()
 {

     String q = 'SELECT count(Id),Name FROM Opportunity group by Name';
     AggregateResult[] agr =Database.query(q);
     String[] strarray = new String[agr.size()];

      for (AggregateResult ar : agr) 
      {
         strarray.add(string.valueOf(ar.get('Name')));
     }

     return strarray ;
     }
   }


    === Page ===



  <apex:page controller="HighChartsController3">
  <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" />
  <script src="https://code.highcharts.com/highcharts.js"></script>
  <script src="https://code.highcharts.com/modules/exporting.js"></script>

   <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>

  <Script>
    $(function () {
     $('#container').highcharts({
     chart: {
        type: 'column'
    },

    title: {
        text: 'Total # of Apllications vs # of Open Jobs'
    },

    xAxis: { 
     categories: {!position}
    // categories: ['abc','parth','hello']         

    },

    yAxis: {
        allowDecimals: false,
        min: 0,
        title: {
            text: 'Number'
        }
    },

    tooltip: {
        formatter: function () {
            return '<b>' + this.x + '</b><br/>' +
                this.series.name + ': ' + this.y + '<br/>' +
                'Total: ' + this.point.stackTotal;
        }
    },

    plotOptions: {
        column: {
            stacking: 'normal'
        }
    },

    series: [{
        name: 'New',
        data: [5, 3, 4, 7, 2],
        stack: 'Application'
    }, {
        name: 'Schedule Interviews',
        data: [3, 4, 4, 2, 5],
        stack: 'Application'
    }, {
        name: 'Hired',
        data: [3, 4, 4, 2, 5],
        stack: 'Application'
    },{
        name: 'Rejected',
        data: [3, 4, 4, 2, 5],
        stack: 'Application'
    },

      {
        name : 'Total Applications',
        data : {!total}            
        //data : [100,200,300],
        stack : 'Total'
        }]
      });
   });

  </script>
 </apex:page>

检查语法,因为问题不在于highcharts,而在于语法。我检查了两次,但并没有看到语法错误。我在这里真的很累,无法前进。类别应该是数组而不是对象。除此之外,JS highcharts是正确的。不幸的是,我不熟悉asp.net,所以我不确定它的语法是否正确。