2013-03-27 16 views
0

我有一個問題,我無法利用劇情區域的整個高度。我正在製作一張圖表來說明在特定類別(A到H)上傳播的人數。氣泡的大小代表了人數。見http://jsfiddle.net/rnilsen/fXzke/8/。氣泡的大小差別很大,從5到600,但看着它時,幾乎看不出尺寸的差異。在高圖氣泡圖中利用全高

內容div只有75px高度。但是,如果我將其更改爲例如300px,你會立即看到一個區別。我希望氣泡看起來與我將其更改爲300像素時相同,但使用較低的圖表以適合一個小空間。

我該如何實現這一點,基本上使用所有可用的高度?

這裏是我用圖表:

$(function() { 
window.chart = new Highcharts.Chart({ 

    chart: { 
     renderTo: 'container', 
     zoomType: 'x', 
     marginBottom: 25, 
     marginTop: 0, 
     plotBorderColor: 'red', 
     plotBorderWidth: 1, 
     spacingTop: 0, 
     spacingBottom: 0, 
    }, 

    credits : { 
     enabled : false 
    }, 

    exporting: { 
     enabled: false 
    }, 

    title: null, 

    xAxis: { 
     lineWidth: 0, 
     lineColor: 'transparent', 
     labels: { 
      enabled: true 
     }, 
     categories: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], 
    }, 

    yAxis: { 
     lineColor: 'transparent', 
     labels: { 
      enabled: false 
     }, 
     title: { text: null }, 
    }, 

    plotOptions: { 
     lineWidth: 0 
    }, 

    legend: { 
     enabled: false 
    }, 

    series: [ 
    { 
     type: 'bubble', 
     lineWidth: 0, 

     data: [ 
      [0, 0, 5], 
      [1, 0, 10], 
      [2, 0, 200], 
      [3, 0, 600], 
      [4, 0, 20], 
      [null,null,null], 
      [6, 0, 500], 
      [7, 0, 400] 
     ], 
    }] 
}); 

});

回答

2

可以選擇設置最小/最大氣泡大小。默認值是最大尺寸是圖表高度的20%。您可以在plotOptions例如: - 改變這種

plotOptions: { 
     lineWidth: 0, 
     bubble: { 
       minSize:2, 
       maxSize:"50%" 
     } 
    }, 

請注意,您還可以設置爲最大像素數。

+0

優秀的,你真的讓我的一天! – Rob 2013-03-27 15:36:06