2013-08-22 60 views
2

我正在與Highcharts合作,並遇到一個小問題,我正在努力克服。Highcharts列間距

我創建了一個的jsfiddle所以你可以看到我的問題:

http://jsfiddle.net/gokninski/qkBsA/

這裏是我使用的代碼:

$('#output-chart').highcharts({ 
     chart: { type: 'column' }, 
     title: { text: null }, 
     xAxis: { categories: ['Column 1', 'Column 2', 'Column 3', 'Column 4'] }, 
     yAxis: { allowDecimals: false, min: 0, labels: { format: '£{value}' }, title: { text: ''} }, 
     plotOptions: { column: { stacking: 'normal'}, series: { pointWidth: 50, pointPadding: 0, groupPadding: 0} }, 
     series: [{ 
      name: 'Product 1 Element 1', 
      data: [0, 100 - 125, 100 - 150, 100 - 175], 
      stack: 'Item1'     
     }, { 
      name: 'Product 1 Element 2', 
      data: [100, 125, 150, 175], 
      stack: 'Item1'       
     }, { 
      name: 'Product 2 Element 1', 
      data: [0, 100 - 125, 100 - 150, 100 - 175], 
      stack: 'Item2'        
     }, { 
      name: 'Product 2 Element 2', 
      data: [100, 125, 150, 175], 
      stack: 'Item2'      
     }] 
    }); 

因此,有在每列兩個酒吧並且我想把這兩個欄對立起來,但是欄之間仍然存在差距。

我希望有道理!

任何幫助將非常感激。

非常感謝

G.

回答

3

您可以使用groupPadding:0.1,然後它會非常接近。

+0

這是一種享受! –

+0

'pointPadding:0'和'groupPadding:0'與'pointRange'的組合,對我的情況非常合適。 – Olga