Highcharts Demo

author(s): Torstein Hønsi

by Mohammad Gouse

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: 'First Fire Dates'
    },
    subtitle: {
        text: ''
    },
    xAxis: {
        type: 'category'
    },
    yAxis: {
        title: {
            text: 'First Fire date'
        }

    },
    legend: {
        enabled: false
    },
    plotOptions: {
        series: {
        	 point: {
                        events: {
                            click: function() {
                                var drilldown = this.data;
                               alert(drilldown)
                            }
                        }
                    },
            borderWidth: 0,
            dataLabels: {
                enabled: true,
                format: '{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": "Years",
            "colorByPoint": true,
            "data": [
                {
                    "name": "2018",
                    "y": 62,
                    "drilldown": "2018"
                },
                {
                    "name": "2017",
                    "y": 3,
                    "drilldown": "2017"
                },
                {
                    "name": "2016",
                    "y": 1,
                    "drilldown": "2016"
                }
               
            ]
        }
    ],
    "drilldown": {
        "series": [
            {
                "name": "2018",
                "id": "2018",
                "data": [
                    [
                        "Jan",
                        4
                    ],
                    [
                        "Feb",
                        3
                    ],
                    [
...