Total Gender 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; max-width: 600px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function () {
// Create the chart
$('#container').highcharts({
chart: {
type: 'pie'
},
title: {
text: 'Total University Gender and Ethnicity, Fall 2015'
},
subtitle: {
text: 'Click the slices to view ethnicity data.'
},
plotOptions: {
series: {
dataLabels: {
enabled: true,
format: '{point.name}: {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: 'Gender',
colorByPoint: true,
data: [{
name: 'Females',
y: 5926,
drilldown: 'Females'
}, {
name: 'Males',
y: 3482,
drilldown: 'Males'
}]
}],
drilldown: {
series: [{
name: 'Females',
id: 'Females',
data: [
['American Indian Only', 27],
['Asian Only', 275],
['Black Only', 119],
['Hispanic/Latino', 1842],
['White Only', 2843],
['Multiracial', 401],
['Pacific Islander Only', 10],
['Unknown', 409]
]
}, {
name: 'Males',
id: 'Males',
data: [
['American Indian Only', 20],
['Asian Only', 208],
['Black Only', 89],
['Hispanic/Latino', 899],
['White Only', 1748],
['Multiracial', 22],
['Pacific Islander Only', 9]
...