Drilldown different chart types - Javascript highcharts

Javascript examples for highcharts:Chart Drilldown

Description

Drilldown different chart types

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
$(function () {/*w w  w .java  2s . c om*/
    // Create the chart
    $('#container').highcharts({
        chart: {
            type: 'pie'
        },
        title: {
            text: 'Basic drilldown'
        },
        xAxis: {
            type: 'category',
            showEmpty: false
        },
        yAxis: {
            showEmpty: false
        },
        legend: {
            enabled: false
        },
        plotOptions: {
            series: {
                borderWidth: 0,
                dataLabels: {
                    enabled: true,
                }
            }
        },
        series: [{
            name: 'Things',
            colorByPoint: true,
            data: [{
                name: 'Animals',
                y: 5,
                drilldown: 'animals'
            }]
        }],
        drilldown: {
            series: [{
                id: 'animals',
                name: 'Animals',
                data: [{
                    name: 'Cats',
                    y: 4,
                    drilldown: 'cats'
                }, ['Dogs', 2],
                    ['Cows', 1],
                    ['Sheep', 2],
                    ['Pigs', 1]
                ]
            }, {
                id: 'cats',
                data: [1, 2, 3],
                type: "column"
            }]
        }
    })
});

      </script> 
   </head> 
   <body> 
      <script src="https://github.highcharts.com/master/highcharts.js"></script> 
      <script src="https://github.highcharts.com/master/modules/drilldown.js"></script> 
      <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>  
   </body>
</html>

Related Tutorials