Reputation: 19
I'm trying to show numbers in my Highcharts stacked columns. I have this issue that can be seen in my left column. When there are two small numbers together only one is shown.
This issue didn't happen with big numbers.
I've tried this so far:
yAxis logarithmic and min: 0:
yAxis: {
min: 0,
AxisTypeValue:'logarithmic',
title: {
text: 'Texto Cantidad'
},
stackLabels: {
enabled: false,
style: {
fontWeight: 'bold',
color: ( // theme
Highcharts.defaultOptions.title.style &&
Highcharts.defaultOptions.title.style.color
) || 'gray'
}
}
},
This is my PlotOptions
plotOptions: {
column: {
grouping: false,
stacking: 'normal',
dataLabels: {
enabled: true,
formatter: function(){
var val = this.y;
if (val < 1) {
return '';
}
return val;
}
}
}
},
Upvotes: 1
Views: 51
Reputation: 39069
The issue is caused by default anti-overlap behaviour for data labels. To display both data labels enable the allowOverlap
option.
plotOptions: {
column: {
...,
dataLabels: {
allowOverlap: true,
...
}
}
}
Live demo: http://jsfiddle.net/BlackLabel/k4vojwea/
API Reference: https://api.highcharts.com/highcharts/series.column.dataLabels.allowOverlap
Upvotes: 1