Highcharts Demo

author(s): Torstein Hønsi

by sqiudward

HTML

<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.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>

<div id="container"></div>

CSS

#container {
    min-width: 360px;
    max-width: 600px;
    height: 400px;
    margin: 0 auto;
}

caption {
	padding-bottom: 15px;
	font-family: 'Verdana';
	font-size: 1.2em;
	color:#555;
}

table {
	font-family: 'Verdana';
	font-size: 12pt;          
	border-collapse: collapse;
	border: 1px solid #EBEBEB;
	margin: 10px auto;
    text-align: center;
    width: 100%;
}

table tr:nth-child(odd) {
  background-color: #fff;
}

table tr:nth-child(even) {
  background-color: #FCF9F9;
}

th {
	font-weight: 600;
    padding: 10px;
}

JavaScript

Highcharts.chart('container', 
{

    chart: {
        polar: true,
        type: 'line'
    },


    title: {
        text: 'Budget vs spending',
        x: -80
    },

    pane: {
        size: '80%'
    },

    xAxis: {
        categories: ['Sales', 'Marketing', 'Development', 'Customer Support',
            'Information Technology', 'Administration'],
        tickmarkPlacement: 'on',
        lineWidth: 0
    },

    yAxis: {
        gridLineInterpolation: 'polygon',
        lineWidth: 0,
        min: 0
    },

    tooltip: {
        shared: true,
        pointFormat: '<span style="color:{series.color}">{series.name}: <b>${point.y:,.0f}</b><br/>'
    },

    legend: {
        align: 'right',
        verticalAlign: 'middle'
    },

    series: [{
        name: 'Allocated Budget',
        data: [43000, 19000, 60000, 35000, 17000, 10000],
        pointPlacement: 'on'
    }, {
        name: 'Actual Spending',
        data: [50000, 39000, 42000, 31000, 26000, 14000],
        pointPlacement: 'on'
    }],

    responsive: {
        rules: [{
            condition: {
                maxWidth: 500
            },
            chartOptions: {
                legend: {
                    align: 'center',
                    verticalAlign: 'bottom'
                },
                pane: {
                    size: '70%'
                }
            }
        }]
    }

});