'Display maximum value of a highcharts stacked column on the bottom
Does anyone know if it's possible to specify the order of display of stacked columns in highcharts ?
I would like to display the biggest value (in %) from the bottom, and I can't find a way to do it.
Thank you
Solution 1:[1]
You can try use special setting for shows sume value yAxis.stackLabels on stacked series. , but it is a setting that shows the sum of column values. To get the maximum value, you should dig into the core and create a wrapp extending-highcharts.
Highcharts.chart('container', {
chart: {
type: 'column'
},
plotOptions: {
column: {
stacking: 'normal',
}
},
yAxis: {
allowDecimals: false,
min: 0,
title: {
text: 'Number of fruits'
},
stackLabels: {
enabled: true,
verticalAlign: 'bottom',
style: {
fontWeight: 'bold'
},
formatter: function() {
var val = this.total;
if (val > 0) {
return val;
}
return '';
},
}
},
series: [{
data: [4, 3, 5, 6, 2, 3]
},
{
data: [4, 3, 5, 6, 2, 3].reverse()
}
]
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Sebastian Hajdus |