Ethnicity Fall 2015
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: 'Student Ethnicity by Academic School and Major, Fall 2015'
},
subtitle: {
text: 'Click the columns to view ethnicity data for individual majors.'
},
xAxis: {
type: 'category'
},
yAxis: {
title: {
text: 'Number of students'
}
},
legend: {
enabled: false
},
plotOptions: {
series: {
borderWidth: 0,
dataLabels: {
enabled: true,
format: '{point.y:f}'
}
}
},
tooltip: {
headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:f}</b> of total<br/>'
},
series: [{
name: "Academic Schools",
colorByPoint: true,
data: [{
name: "Arts and Humanities",
y: 1395,
drilldown: "Arts and Humanities"
}, {
name: "Business and Economics",
y: 1667,
drilldown: "Business and Economics"
}, {
name: "Education",
y: 409,
drilldown: 'Education'
}, {
name: "Science and Technology",
y: 1948,
drilldown: "Science and Technology"
}, {
name: "Social Science",
y: 2570,
drilldown: "Social Science"
}, {
name: "Undeclared",
y: 1409,
drilldown: "Undeclared"
}]
}],
drilldown: {
series: [{
name: "Arts and Humanities",
id: "Arts and Humanities",
data: [
[
"American Indian Only",
9
],
[
"Asian Only",
50
],
[
"Black Only",
30
],
[
"Hispanic/Latino",
343
],
[
"White Only",
757
...