2014-02-26 118 views
0

鑑於遵循Highcharts.Chart(options)Highcharts錯誤#18 - Highcharts.Chart(選項)

{ 
       "chart": { 
        "type": "spline" 
       }, 
       "title": { 
        "text": "", 
        "x": -20 
       }, 
       "subtitle": { 
        "text": "", 
        "x": -20 
       }, 
       "xAxis": [ 
        "23 Jun", 
        "24 Jun", 
        "25 Jun", 
        "26 Jun", 
        "27 Jun", 
        "28 Jun", 
        "29 Jun" 
       ], 
       "yAxis": { 
        "title": { 
         "text": "" 
        }, 
        "plotLines": [ 
         { 
          "value": 0, 
          "width": 1, 
          "color": "#808080" 
         } 
        ] 
       }, 
       "legend": { 
        "layout": "vertical", 
        "align": "right", 
        "verticalAlign": "middle", 
        "borderWidth": 0 
       }, 
       "series": [ 
        { 
         "name": "exposed", 
         "data": [ 
          100, 
          200, 
          150, 
          130, 
          180, 
          200, 
          190 
         ], 
         "dashStyle": "longdash" 
        }, 
        { 
         "name": "converted", 
         "data": [ 
          90, 
          80, 
          70, 
          75, 
          70, 
          80, 
          85 
         ], 
         "dashStyle": "longdash" 
        }, 
        { 
         "name": "engaged", 
         "data": [ 
          30, 
          40, 
          35, 
          40, 
          48, 
          30, 
          33 
         ], 
         "dashStyle": "longdash" 
        } 
       ] 
      } 

當我與畫它 - $('#container').highcharts({...})它會提示錯誤 -

Uncaught Highcharts error #18: www.highcharts.com/errors/18 

http://www.highcharts.com/errors/18

你可以看到它 - jsFiddle

options格式有什麼不對?

回答

5

定義一個容器中的jsfiddle

存在與x軸的problème。你必須定義一個對象不僅僅是一個數組。 Ex

"xAxis": {categories: [ 
        '23 Jun', 
        '24 Jun', 
        '25 Jun', 
        '26 Jun', 
        '27 Jun', 
        '28 Jun', 
        '29 Jun' 
          ]} 

您是否期望有這樣的想法http://jsfiddle.net/x4YbZ/