2013-06-27 42 views
0

我正在動態添加高圖系列。我的設置如下。高圖..瀏覽器停止加載圖表

new Highcharts.Chart({ 
    "name": "Ratingovertijrrrrrrrrr", 
    "CID": 59, 
    "type": 1, 
    "chart": { 
     "type": "area", 
     "zoomType": "xy", 
     "animation": true, 
     "renderTo": "CHART_01" 
    }, 
    "colors": ["#fae570", "#e4b9b9", "#dc7474"], 
    "exporting": { 
     "enabled": true 
    }, 
    "legend": { 
     "enabled": true, 
     "floating": false, 
     "layout": "horizontal", 
     "align": "center", 
     "verticalAlign": "bottom", 
     "backgroundColor": "" 
    }, 
    "plotOptions": { 
     "series": { 
      "allowPointSelect": false, 
      "animation": true, 
      "showInLegend": true, 
      "dataLabels": { 
       "enabled": false 
      }, 
      "stacking": "normal" 
     } 
    }, 
    "subtitle": { 
     "text": "over tijd", 
     "style": { 
      "fontFamily": "Arial", 
      "fontSize": "14px", 
      "fontWeight": "normal", 
      "fontStyle": "normal", 
      "color": "#000000" 
     } 
    }, 
    "title": { 
     "text": "Rating", 
     "style": { 
      "fontFamily": "Arial", 
      "fontSize": "18px", 
      "fontWeight": "normal", 
      "fontStyle": "normal", 
      "color": "#000000" 
     } 
    }, 
    "tooltip": { 
     "enabled": true, 
     "shared": true, 
     "animation": true, 
     "crosshairs": [true, false], 
     "backgroundColor": "#79e538", 
     "formatter": function() { 
      return '<b>' + this.series.name + ':</b>' + this.y; 
     } 
    }, 
    "xAxis": { 
     "title": { 
      "text": "Date", 
      "enabled": false, 
      "style": { 
       "fontFamily": "Arial", 
       "fontSize": "8px", 
       "fontWeight": "normal", 
       "fontStyle": "normal", 
       "color": "" 
      } 
     }, 
     "type": "datetime", 
     "minRange": "60000", 
     "startOfWeek": "1", 
     "dateTimeLabelFormats": { 
      "millisecond": "%H:%M:%S.%L", 
      "second": "%H:%M:%S", 
      "minute": "%H:%M", 
      "hour": "%H:%M", 
      "day": "%e. %b", 
      "week": "%e. %b", 
      "month": "%b '%y", 
      "year": "%Y" 
     }, 
     "categories": [""], 
     "labels": { 
      "enabled": true, 
      "align": "center", 
      "rotation": "0", 
      "x": "0", 
      "y": "15" 
     } 
    }, 
    "yAxis": { 
     "title": { 
      "text": "Rating", 
      "enabled": false, 
      "style": { 
       "fontFamily": "Arial", 
       "fontSize": "8px", 
       "fontWeight": "normal", 
       "fontStyle": "normal", 
       "color": "" 
      } 
     }, 
     "type": "linear", 
     "minRange": "", 
     "startOfWeek": "1", 
     "dateTimeLabelFormats": { 
      "millisecond": "%H:%M:%S.%L", 
      "second": "%H:%M:%S", 
      "minute": "%H:%M", 
      "hour": "%H:%M", 
      "day": "%e. %b", 
      "week": "%e. %b", 
      "month": "%b '%y", 
      "year": "%Y" 
     }, 
     "categories": [""], 
     "labels": { 
      "enabled": true, 
      "align": "center", 
      "rotation": "", 
      "x": "", 
      "y": "" 
     } 
    }, 
    "series": [{ 
     "data": [0], 
     "name": "Loading...", 
     "loadingSeries": true 
    }], 
    credits: { 
     enabled: false 
    } 
}); 

CHART_01是容器ID。最初加載將顯示..之後,ajax發送到服務器以獲取系列列表..並在ajax函數的成功回調上動態添加系列。

問題是瀏覽器停止工作


編輯:

當我改變輸入到linear

"xAxis": {  
     "type": "linear", 
     "minRange": "0" 

它的工作...什麼是問題與"type": "datetime"

+1

如果在加載系列後出現這種情況,請添加系列示例。特別是數據。 –

+0

你沒有向我們展示最相關的代碼;您的ajax電話以及您如何添加系列... – Mark

+0

@PawełFus不會發生頁面加載 – rab

回答

1

問題與設置xAxis。在Highcharts中,不可能在同一時間分類軸和datetime。同樣當設置minRange爲分類圖表的某些高值(例如60 000)時,Highcharts預計將顯示至少60 000個類別,這是不可能在寬度爲1000px的圖表上顯示60 000個xAxis標籤的。

相關問題