Spring 15 Degrees
author(s):
Torstein Hønsi
by Kathryn Atwood
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/data.js"></script>
<script src="https://code.highcharts.com/modules/drilldown.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function () {
// Create the chart
$('#container').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Degrees Awarded in Spring 2015'
},
subtitle: {
text: 'Click the columns to view the number of degrees awarded by individual departments.'
},
xAxis: {
type: 'category'
},
yAxis: {
title: {
text: 'Number of degrees'
}
},
legend: {
enabled: false
},
plotOptions: {
series: {
borderWidth: 0,
dataLabels: {
enabled: true,
format: '{point.y}'
}
}
},
tooltip: {
headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y}</b> degrees<br/>'
},
series: [{
name: 'Academic Schools',
colorByPoint: true,
data: [{
name: 'Arts and Humanities',
y: 257,
drilldown: 'Arts and Humanities'
}, {
name: 'Business and Economics',
y: 279,
drilldown: 'Business and Economics'
}, {
name: 'Education',
y: 72,
drilldown: 'Education'
}, {
name: 'Science and Technology',
y: 258,
drilldown: 'Science and Technology'
}, {
name: 'Social Science',
y: 541,
drilldown: 'Social Science'
}]
}],
drilldown: {
series: [{
name: 'Arts and Humanities',
id: 'Arts and Humanities',
data: [
[
'Am....