JavaScript
var chart;
$(document).ready(function() {
Highcharts.setOptions({
colors: ['#FAAED4', '#F7989E', '#FE7899', '#FF7B89', '#EB92A8', '#FF6E7B', '#F59AC3', '#8CC6EC', '#01B5F0', '#5090CD', '#8686C2', '#8686C2', '#0076BE',
'#7B79BA', '#FFF572', '#FFC353', '#FEE46B', '#FFF203', '#FFC758', '#FEC689', '#FCC19F', '#00B191', '#74C698', '#0CB24E', '#00AB8B', '#50B847', '#01B08F'],
});
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'bar'
},
title: {
text: 'Historic World Population by Region'
},
subtitle: {
text: 'Source: Wikipedia.org'
},
xAxis: {
categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania'],
title: {
text: null
}
},
yAxis: {
min: 0,
title: {
text: 'Population (millions)',
align: 'high'
}
},
tooltip: {
formatter: function() {
return ''+
this.series.name +': '+ this.y +' millions';
}
},
plotOptions: {
bar: {
dataLabels: {
enabled: true
}
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -100,
y: 100,
floating: true,
borderWidth: 1,
backgroundColor: '#FFFFFF',
shadow: true
},
credits: {
enabled: false
},
series: [{
name: 'Year 1800',
data: [107, 31, 635, 203, 2]
}, {
name: 'Year 1900',
data: [133, 156, 947, 408, 6]
}, {
name: 'Year 2008',
data: [973, 914, 4054, 732, 34]
}]
});
});