Reputation: 3356
Currently, my Highcharts data labels are aligned to the bars:
I would like to have the data labels aligned to the right border:
Any Ideas?
Uadate
Solved thanks to Pawel:
...
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
}],
...
Upvotes: 1
Views: 899
Reputation: 45079
For chart with fixed width set for dataLabels:
plotOptions: {
bar: {
dataLabels: {
enabled: true,
align: 'left',
inside: true,
x: 390
}
}
},
Demo: http://jsfiddle.net/zf7te5ef/
If you have responsive chart, how about using separate xAxis for this? Like this:
xAxis: [{
categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania']
}, {
opposite: true,
linkedTo: 0,
categories: [107, 31, 635, 203, 2]
}],
Demo: http://jsfiddle.net/zf7te5ef/1/
If this is not enough for you, then read this question.
Upvotes: 1