Age group 80+

Up to 31 December of each year, 2011 - 2021

by Federico Ferraris Sánchez

HTML

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

<figure class="highcharts-figure">
    <div id="container"></div>
    <p class="highcharts-description">
    </p>
</figure>

CSS

#container {
    height: 570px; 
}

.highcharts-figure, .highcharts-data-table table {
    min-width: 310px; 
    max-width: 1250px;
    margin: 1em auto;
}

.highcharts-data-table table {
    font-family: Verdana, sans-serif;
    border-collapse: collapse;
    border: 1px solid #EBEBEB;
    margin: 10px auto;
    text-align: center;
    width: 100%;
    max-width: 500px;
}
.highcharts-data-table caption {
    padding: 1em 0;
    font-size: 1.2em;
    color: #555;
}
.highcharts-data-table th {
	font-weight: 600;
    padding: 0.5em;
}
.highcharts-data-table td, .highcharts-data-table th, .highcharts-data-table caption {
    padding: 0.5em;
}
.highcharts-data-table thead tr, .highcharts-data-table tr:nth-child(even) {
    background: #f8f8f8;
}
.highcharts-data-table tr:hover {
    background: #f1f7ff;
}

JavaScript

Highcharts.chart('container', {
    chart: {
        type: 'line'
    },
    exporting: {
      sourceWidth: 1200,
      sourceHeight: 600,
      allowHTML: true
    },
    title: {
        text: 'Age group 80+ data 2011 - 2021'
    },
    subtitle: {
        text: 'Up to 31 December of each year'
    },
    legend: {
        layout: 'horizontal',
        align: 'center',
        verticalAlign: 'bottom',
        borderWidth: 1,
        backgroundColor:
            Highcharts.defaultOptions.legend.backgroundColor || '#FFFFFF'
    },
    xAxis: {
    		title: {
        	text: 'Year'
        },
        categories: [
            2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
        ]
    },
    yAxis: [{
        title: {
            text: 'Inhabitants',
            style: {
      				color: 'rgba(29, 40, 189, .7)'
            }
        },
        tickAmount: 11,
        labels: {
            style: {
      				color: 'rgba(29, 40, 189, .7)'
            }
        },
        min: 4000000,
        max: 6500000
    },{
        title: {
            text: 'Deaths percentage within the age group'
        },
        tickAmount: 11,
        labels: {
            format: '{value} %'
        },
        min: 8,
        max: 10,
        opposite: true
    },{
        title: {
            text: 'Number of deaths',
            style: {
      				color: 'rgba(255, 0, 0, .7)'
            }
        },
        tickAmount: 11,
        labels: {
            style: {
      				color: 'rgba(255, 0, 0, .7)'
            }
        },
        min: 325000,
        max: 575000,
        opposite: true
    }],
    tooltip: {
        shared: true
        //,valueSuffix: ' units'
    },
    credits: {
        enabled: false
    },
    plotOptions: {
      series: {
            marker: {
                radius: 2.5
            },
      	groupPadding: 10.2,
        dataLabels: {
          enabled: true,
          style: {
          	fontSize: '11px',
            fontWeight: 'bold'
         ...