2013-07-16 86 views
0

我正在創建一個高圖表,我希望滾動條被啓用。我的滾動條不工作,有什麼想法可能會在這裏失蹤?如何讓高滾動條上的滾動條工作

$('#add_trans').highcharts('StockChart', { 
      chart: { 
       borderColor: '#801500', 
       borderRadius: 20, 
       borderWidth: 1, 
       type: 'line', 
       events: { 
        load: function(chart) { 
         this.setTitle(null, { 

         }); 
        } 
       }, 
       zoomType: 'x' 

      }, 
      exporting: { 
       enabled: true 
      }, 
      legend: { 
       enabled: true 
       }, 
      rangeSelector: { 
       buttons: [{ 
         type: 'minute', 
         count: 60, 
         text: 'hourly' 
        }, { 
        type: 'all', 
        text: 'All' 
       }], 
       // selected: 1 
      }, 
      scrollbar: { 
       enabled: true 
      }, 
      navigator : { 
       enabled : true 
      }, 
      xAxis: { 
      labels: { 
       enabled: true 
       } 

      }, 

      yAxis : { 
       title : { 
        text : 'Response Time' 
       }, 

       tickInterval: 100 
      }, 

     }); 

回答

1

錯誤有些錯誤可能:

  • 。在你的highcharts代碼沒有series:{},所以圖表沒有數據的代碼。
  • 額外的逗號引起問題,所以刪除:

代碼:

yAxis : { 
title : { 
    text : 'Response Time' 
}, 
tickInterval: 100 
},//comma from here if there is no section after it 

和:

rangeSelector: { 
    buttons: [{ 
      type: 'minute', 
      count: 60, 
      text: 'hourly' 
     }, { 
     type: 'all', 
     text: 'All' 
    }],   //from here if next statement is commented 
    // selected: 1 
}, 

如果你的代碼仍然不工作,你可以嘗試改變這種:

<script type="text/javascript" src="js/highcharts.js"></script> 

與此:

<script type="text/javascript" src="http://www.highcharts.com/js/highstock.js"></script> 
+0

我已經在使用highstock.js,並刪除了額外的逗號。沒有變化,我仍然無法滾動。 – user1471980

+0

你得到的任何錯誤?你的數據是什麼? –

+0

我正在使用jquery選項卡,由於某種原因它正在影響highcharts,不知道發生了什麼事 – user1471980