JSFiddle - React, Tailwind, and code Playground

by gajjargaurav

HTML

<script src="http://github.highcharts.com/rambera/highcharts.js"></script>
<script src="http://github.highcharts.com/rambera/modules/drilldown.js"></script>
<div id="container2" style="height: 300px; width: 600px; margin: 0 auto"></div>

JavaScript

// Internationalization
Highcharts.setOptions({
    lang: {
        drillUpText: '◁ Back to {series.name}'
    }
});

var options = {

    chart: {
        height: 300
    },
    
    title: {
        text: 'Highcharts Drilldown Plugin'
    },

    xAxis: {
        categories: true,
        labels: {
            style: { // Normal values. TODO: Make the plugin reset all labels automatically
                cursor: 'auto',
                fontWeight: 'normal',
                textDecoration: 'none'
            }
        }
    },
    
    drilldown: {
        activeAxisLabelStyle: {
            cursor: 'pointer',
            color: '#039',
            fontWeight: 'bold',
            textDecoration: 'underline'            
        },
        activeDataLabelStyle: {
            cursor: 'pointer',
            color: '#039',
            fontWeight: 'bold',
            textDecoration: 'underline'            
        },
        animation: {
            duration: 500
        },
        series: [{
            id: 'fruits',
            name: 'Fruits',
            data: [
                ['Apples', 4],
                ['Pears', 6],
                ['Oranges', 2],
                ['Grapes', 8]
            ]
        }, {
            id: 'cars',
            name: 'Cars',
            data: [{
                name: 'Toyota', 
                y: 4,
                drilldown: 'toyota'
            },
            ['Volkswagen', 3],
            ['Opel', 5]
            ]
        }, {
            id: 'toyota',
            name: 'Toyota',
            data: [
                ['RAV4', 3],
                ['Corolla', 1],
                ['Carina', 4],
                ['Land Cruiser', 5]
            ]
        }]
    },
    
    legend: {
        enabled: false
    },
    
    plotOptions: {
        series: {
            dataLabels: {
                enabled: true
            },
            shadow: false
        },
        pie: {
            size: '80%'
        }
    },
    
    series: [{
  ...