Highcharts Demo

author(s): Torstein Hønsi

by Kondal Durgam

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>


<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>

JavaScript

Highcharts.chart('container', {
    chart: {
        type: 'column'
    },
    title: {
        text: 'Gender By Distribution'
    },
    credits: {
        enabled: false
    },
    xAxis: {
        categories: ['2017', '2018', '2019', '2020']
    },
    yAxis: {
        min: 0,
        title: {
            text: ''
        },
        stackLabels: {
            enabled: false,
            
        }
    },
    yAxis: [{
        labels: {
            format: '{value} %'
        },

        min: 0,
        max: 60,
        opposite: false
    }],
    tooltip: {
        headerFormat: '<b>{point.x}</b><br/>',
        pointFormat: '{series.name}: {point.y}<br/>Total: {point.stackTotal}'
    },
    plotOptions: {
        column: {
            stacking: 'percent',
            dataLabels: {
                enabled: false,
                
            }
        }
    },
    series: [{
        name: 'Male',
        data: [5, 8, 4, 3 ]
    }, {
 
        name: 'Female',
        data: [3, 4, 4, 2 ]
    }]
});