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; height: 400px; margin: 0 auto"></div>

JavaScript

// Create the chart
Highcharts.chart('container', {
    chart: {
        type: 'column'
    },
    title: {
        text: 'Enrollment by Academic School, Fall 2018'
    },
    subtitle: {
        text: 'Click the columns to view enrollment data for individual majors.'
    },
    xAxis: {
        type: 'category'
    },
    yAxis: {
        title: {
            text: 'Number of students'
        }

    },
    legend: {
        enabled: false
    },
    plotOptions: {
        series: {
            borderWidth: 0,
            dataLabels: {
                enabled: true,
            }
        }
    },

    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": 1523,
                    "drilldown": "Arts and Humanities"
                },
                {
                    "name": "Business and Economics",
                    "y": 1575,
                    "drilldown": "Business and Economics"
                },
                {
                    "name": "Education",
                    "y": 499,
                    "drilldown": "Education"
                },
                {
                    "name": "Science and Technology",
                    "y": 2065,
                    "drilldown": "Science and Technology"
                },
                {
                    "name": "Social Science",
                    "y": 2285,
                    "drilldown": "Social Science"
                },
                {
                    "name": "Undeclared",
                    "y": 1249,
                    "drilldown": null
                }
            ]
        }
    ],
    "drilldown": {
       ...