JavaScript
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Stacked column chart'
},
xAxis: {
lineWidth: 2,
type: 'datetime'
},
yAxis: {
min: 0,
title: {
text: 'Total fruit consumption'
},
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
}
}
},
legend: {
align: 'right',
x: -70,
verticalAlign: 'top',
y: 20,
floating: true,
backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
borderColor: '#CCC',
borderWidth: 1,
shadow: false
},
tooltip: {
formatter: function () {
return '<b>' + this.x + '</b><br/>' +
this.series.name + ': ' + this.y + '<br/>' +
'Total: ' + this.point.stackTotal;
}
},
plotOptions: {
column: {
stacking: 'normal',
dataLabels: {
enabled: true,
color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white',
style: {
textShadow: '0 0 3px black, 0 0 3px black'
}
}
}
},
series: [{
name: 'Apples',
data: [[Date.UTC(2014, 0, 1),5], [Date.UTC(2014, 0, 2),3], [Date.UTC(2014, 0, 4),2], [Date.UTC(2014, 0, 5),7], [Date.UTC(2014, 0, 6),8]]
}, {
name: 'Oranges',
data: [[Date.UTC(2014, 0, 1),3], [Date.UTC(2014, 0, 2),7], [Date.UTC(2014, 0, 4),9], [Date.UTC(2014, 0, 5),11],...