Highcharts - Stacked single Column chart
by katalin_2003
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function() {
$('#container').highcharts({
chart: {
type: 'column'
},
credits: {
enabled: false
},
title: {
text: 'Sales pipeline'
},
xAxis: {
categories: ['2016']
},
yAxis: {
min: 0,
title: {
text: 'Orders 2016'
},
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
}
}
},
legend: {
align: 'right',
x: 0,
verticalAlign: 'bottom',
y: 0,
floating: true,
backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
borderColor: '#CCC',
borderWidth: 1,
shadow: false
},
tooltip: {
headerFormat: '<b>{point.x}</b><br/>',
pointFormat: '{series.name}: {point.y}<br/>Total: {point.stackTotal}'
},
plotOptions: {
column: {
stacking: 'normal',
dataLabels: {
enabled: true,
color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white',
style: {
textShadow: false
}
}
}
},
series: [{
name: 'Jan',
data: [771911]
}, {
name: 'Feb',
data: [976040]
}, {
name: 'Mar',
data: [1254977]
}, {
name: 'Apr',
data: [1391240]
}, {
name: 'Mai',
data: [625880]
}, {
name: 'Jun',
data: [1590770]
}, {
name: 'Jul',
data: [435060]
}, {
name: 'Aug',
data: [397880]
}, {
name: 'Sep',
data: [1318900]
}, {
name: 'Oct',
data: [948160]
}, {
name: 'Nov',
data: [441640]
}, {
name: 'Dec',
data: [1217960]
}, ]
});
});