I'm generating a bar chart and currently all data labels are aligned to the right.
For positive values, I would like the data label aligned to the right of the bar and for negative values I would like the data label aligned to the left of the bar.
How can I achieve this?
$(function () {
$('#container').highcharts({
chart: {
type: 'bar'
},
xAxis: {
categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania']
},
plotOptions: {
bar: {
dataLabels: {
enabled: true,
align: 'right',
inside: true
}
}
},
series: [{
data: [107, 31, 635, -203, -300]
}]
});
});