Highcharts Demo

author(s): Torstein Hønsi

by Saurabh Khemka

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; max-width: 800px; height: 400px; margin: 0 auto"></div>

JavaScript

Highcharts.chart('container', {
    chart: {
        type: 'bar', marginTop: 50,
        marginBottom: 50,
        marginLeft: 100,
        marginRight: 50
    },
    title: {
        text: ''
    },
    subtitle: {
        //text: 'Source: <a href="https://en.wikipedia.org/wiki/World_population">Wikipedia.org</a>'
    },
    xAxis: {
        categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania', 'Africa', 'America', 'Asia', 'Eurca'],
        lineWidth: 0,
        tickLength: 0,
        title: {
            align: 'high',
            text: 'COMMODITY',
            rotation: 0,
            y: 0,
            x: 45,
            textAlign: 'right',
            margin: 0
        },
    },
    labels: {
        items: [{
            html: '<h1>BEARISH</h1>',
            style: {
                left: '0px',
                top: '-12px'
            }
        },
        {
            html: '<h1>NEUTRAL</h1>',
            style: {
                left: '250px',
                top: '-12px'
            }
        },
        {
            html: '<h1>BULLISH</h1>',
            style: {
                left: '500px',
                top: '-12px'
            }
        }]
    },
    navigation: {
        buttonOptions: {
            enabled: false
        }
    },
    yAxis: {
        offset: -15,
        min: 0,
        labels: {
            overflow: 'justify'
        },
        gridLineWidth: 0,
        visible: false
    },
    tooltip: {
        //valueSuffix: ' millions'
    },
    plotOptions: {
        bar: {
            dataLabels: {
                enabled: false
            },
            tooltip: {
                pointFormat: '<b>{point.y}</b>'
            },
            pointWidth: 15,
            pointPadding: 0,
            groupPadding: 0,
            stacking: 'normal'

        },
        series: {
            showInLegend: false
        }
    },
    credits: {
        enabled: false
    },
    series: [{
        data: [5, 3, 4, 7, 2]
    }]
});