Highcharts Demo

author(s): Torstein Hønsi

by austinnoronha

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: 'line'
    },
    title: {
        text: ''
    },
    subtitle: {
        text: ''
    },
    xAxis: {
    		
        type: 'datetime',
        tickWidth: 0,
            gridLineWidth: 0,
            labels: {
                align: 'left',
                x: 0,
                y: 30,
                rotation: -20
            },
        dateTimeLabelFormats: { // don't display the dummy year
            month: '%e/%m/%Y',
            year: '%b'
        },
        title: {
            text: ''
        }
    },
    yAxis: [{ // left y axis
            title: {
                text: "(-1) Dovish / Hawkish (+1)"
            },
            labels: {
                align: 'left',
                x: 3,
                y: 16,
                format: '{value:.,0f}'
            },
            showFirstLabel: false
        }, { // right y axis
            linkedTo: 0,
            gridLineWidth: 0,
            opposite: true,
            title: {
                text: "Inflation Employment"
            },
            labels: {
                align: 'right',
                x: -3,
                y: 16,
                format: '{value:.,0f}'
            },
            showFirstLabel: false
        }],
    
    legend: {
            align: 'center',
            verticalAlign: 'top',
            y: 0,
            floating: false,
            borderWidth: 0
        },

        
    tooltip: {
    		    shared: true,
            crosshairs: true,
        headerFormat: '<b>{series.name}</b><br>',
        pointFormat: '{point.x:%e. %b}: {point.y:.2f} m'
    },

    plotOptions: {
        spline: {
            marker: {
                enabled: true
            }
        }
    },

    series: [{
        name: 'Dovish Hawkish',
        // Define the data points. All series have a dummy year
        // of 1970/71 in order to be compared on the same x axis. Note
        // that in JavaScript, months start at 0 for January, 1...