2014-10-06 72 views
1

目前,我Highcharts數據標籤對準條:拉HighCharts數據標籤向右

The current chart

我想有一致的權利邊界數據標籤:

The desired chart

任何想法?

Uadate

解決由於帕維爾:

... 
xAxis: [{ 
    categories: data[dimension].keys, 
    gridLineWidth: 0, 
    lineWidth: 0, 
    minorGridLineWidth: 0, 
    lineColor: 'transparent', 
    minorTickLength: 0, 
    tickLength: 0 
}, { 
    opposite: true, 
    linkedTo: 0, 
    categories: data[dimension].value, 
    gridLineWidth: 0, 
    lineWidth: 0, 
    minorGridLineWidth: 0, 
    lineColor: 'transparent', 
    minorTickLength: 0, 
    tickLength: 0 
}], 
... 

回答

1

對於具有固定寬度dataLabels設置圖表:

plotOptions: { 
     bar: { 
      dataLabels: { 
       enabled: true, 
       align: 'left', 
       inside: true, 
       x: 390 
      } 
     } 
    }, 

演示:http://jsfiddle.net/zf7te5ef/

如果你有迴應圖表,如何使用單獨的xAxis呢?就像這樣:

xAxis: [{ 
     categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania'] 
    }, { 
     opposite: true, 
     linkedTo: 0, 
     categories: [107, 31, 635, 203, 2] 
    }], 

演示:http://jsfiddle.net/zf7te5ef/1/

如果這還不夠你,然後閱讀this question

+0

謝謝Paweł!我用你的第二種方法。 – Michael 2014-10-07 08:04:51