JavaScript
var opt = Highcharts.getOptions(), col=opt.colors, negEps=-0.0000001;
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
defaultSeriesType: 'area',
},
legend: {
enabled: true,
},
tooltip: {
shared: true,
},
xAxis: {
categories: [2009, 2010, 2011, 2012]
},
yAxis: {
title: {
text: 'Gross Profit in USD',
},
},
plotOptions: {
series: {
marker: {
enabled: false,
},
states: {
hover: {
enabled: false
}
},
stacking: 'normal'
},
},
series: [{
name: 'Company A',
data: [20000, 25000, 23000, 20000],
color: col[0]
}, {
name: 'Company B',
data: [5000, 10000, 0, 0],
color: col[1]
}, {
name: 'Company C',
data: [10000, 4000, 0, 0],
color: col[2]
}, {
name: 'Company C',
data: [negEps, negEps, negEps, -15000],
color: col[2],
legendIndex: false,
}, {
name: 'Company B',
data: [negEps, negEps, -5000, -7000],
color: col[1],
legendIndex: false,
}, {
name: 'Company A',
data: [negEps, negEps, negEps, -20000],
color: col[0],
legendIndex: false,
}]
});