Basic line

author(s): Torstein Hønsi

by Black Label

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>

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

CSS

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

JavaScript

Highcharts.chart('container', {
chart: {type:'bar'},

    xAxis: {
    	categories: ['Lorem impsum', 'dolor sit amet'],
      opposite: true,
      width: '48%',
      lineWidth: 0,
      labels: {
      	align: 'center',
      	reserveSpace: false
      },
      offset: 0
    },
    legend: {
        enabled: false
    },
    yAxis: [{
    	left: '0%',
    	width: '40%',
      reversed: true,
      title: {
      	text: 'Pro'
      },
      opposite: true
    },{
    	width: '40%',
      left: '60%',
      offset: 0,
      title: {
      	text: 'Contra'
      },
      max: 30000,
      opposite: true
    }],

    series: [{
        name: 'Installation',
        data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
    }, {
        name: 'Manufacturing',
        data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434]
    }, {
        name: 'Installation',
        yAxis: 1,
        data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387]
    }, {
        name: 'Manufacturing',
        yAxis: 1,
        data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227]
    }]

});