Highcharts Demo
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; max-width: 600px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function () {
// Create the chart
$('#container').highcharts({
chart: {
type: 'pie'
},
title: {
text: 'Student Body by Unit Level and Academic School'
},
subtitle: {
text: 'Click the slices to view the academic school student body.'
},
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: 'Academic Level',
colorByPoint: true,
data: [{
name: 'Freshmen',
y: 2705,
drilldown: 'Freshmen'
}, {
name: 'Sophomores',
y: 1351,
drilldown: 'Sophomores'
}, {
name: 'Juniors',
y: 2085,
drilldown: 'Juniors'
}, {
name: 'Seniors',
y: 2474,
drilldown: 'Seniors'
}, {
name: 'Postbaccalaureate',
y: 793,
drilldown: 'Postbaccalaureate'
}]
}],
drilldown: {
series: [{
name: 'Freshmen',
id: 'Freshmen',
data: [
['Education', 81],
['Business and Economics', 378],
['Arts and Humanities', 319],
['Science and Technology', 519],
['Social Science', 521],
['Undeclared', 887]
]
}, {
name: 'Sophomores',
id: 'Sophomores',
...