2016-02-22 90 views
1

我有一個圖表使用分組類別highcharts,我有succesfull使圖表,但我有點問題。刪除相同父類別上的空間|分組類別Highcharts

示例圖表:Fiddle here

它能夠除去具有相同父列之間的空間/或改變的空間,所以這將是彼此接近?

在例如

apple, banana, orange = group as fruit 

    carrot, potato, tomato = group as vegetable 

    cod, salmon, tuna  = group as fish 

我想:

between apple, banana, orange the column is near 
and between orange - carrot is still have space. 

我曾試圖改變風格,但我仍然無法弄清楚。

感謝

回答

2

您可以使用在內部和verticalAlign plotOptions這些選項,以顯示在底部標貼。

plotOptions: { 
    series: { 
    dataLabels: { 
     enabled: true, 
     inside: true, 
     verticalAlign: 'bottom', 
     formatter: function() { 
     return this.point.name; 
     } 
    }, 
    } 
}, 

我不得不改變該系列的結構,可以很容易地顯示:

series: [{name:'Fruits', 
     data: [{y:4, name:'Apple'}, {y:14, name:'Banana'},{y:18, name:'Orange'}] 
    }, {name:'Vegetable', 
     data: [{y:5, name:'Carrot'}, {y:6, name:'Potato'}, {y:5, name:'Tomato'}] 
    }, {name:'Fish', 
     data: [{y:14, name:'Cod'}, {y:15, name:'Salmon'} ,{y:18, name:'Tuna'}] 
    }] 
    }); 

例如jsfiddle

+0

謝謝謝謝:) :), –

+0

不客氣:) –

1

我有不同勢風格[的jsfiddle] [1數字出來太]

  [1]: http://jsfiddle.net/rikad/gptrz8Lh/