Highcharts Demo
author(s): Torstein Hønsi
by mlmason
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: 'Public Services'
},
subtitle: {
text: ''
},
xAxis: {
type: 'category'
},
yAxis: {
title: {
text: 'Number of Mentions'
}
},
legend: {
enabled: false
},
plotOptions: {
series: {
borderWidth: 0,
dataLabels: {
enabled: true,
format: '{point.y:.0f}'
}
}
},
/* tooltip: {
headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
},*/
series: [{
name: 'Number of Mentions',
colorByPoint: true,
data: [{
name: 'Government',
y: 146,
drilldown: 'Government'
}, {
name: 'Police/Sheriff',
y: 20,
drilldown: 'Police/Sheriff'
}, {
name: 'Road/Roads/Roadway',
y: 18,
drilldown: 'Road/Roads/Roadway'
},
{
name: 'Services',
y: 72,
drilldown: 'Services'
},
{
name: 'Water',
y: 68,
drilldown: 'Water'
},
]
}],
drilldown: {
series: [{
name: 'Government',
id: 'Government',
data: [
[
'2011',
29 ],
[
'2012',
...