Grads by School/Major Sp16
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
Highcharts.chart('container', {
chart: {
type: 'column'
},
title: {
text: 'Total Graduates by School and Major, Spring 2016'
},
subtitle: {
text: 'Click the columns to view graduation totals for individual majors.'
},
xAxis: {
type: 'category'
},
yAxis: {
title: {
text: 'Total percent market share'
}
},
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> of total<br/>'
},
series: [{
name: 'Academic Schools',
colorByPoint: true,
data: [{
name: 'Arts and Humanities',
y: 247,
drilldown: 'Arts and Humanities'
}, {
name: 'Business and Economics',
y: 224 ,
drilldown: 'Business and Economics'
}, {
name: 'Education',
y: 73,
drilldown: 'Education'
}, {
name: 'Science and Technology',
y: 288,
drilldown: 'Science and Technology'
}, {
name: 'Social Science',
y: 496,
drilldown: 'Social Science'
}]
}],
drilldown: {
series: [{
name: 'Arts and Humanities',
id: 'Arts and Humanities',
data: [
[
...