Highcharts Demo

author(s): Torstein Hønsi

by pepperdigital

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>

<div id="container" style="height: 600px"></div>

JavaScript

Highcharts.chart('container', {

	    title: {
	        text: 'Afkast af investeret kapital'
	    },
	        credits: {
	        enabled: false
	    },
	     exporting: {
	        enabled: false
	    },
	    subtitle: {
	        text: 'Region'
	    },
	   colors: ['#86BC25', '#43B02A', '#046A38', '#0097A9', '#62B5E5', 
	   '#00A3E0', '#0076A8', '#012169', '#2C5234', '#C4D600'],

	    yAxis: {
	      //  min: 0,
	     //   max: 60,
	        labels: {
	            format: '{value}%'
	        },
	        title: {
	            text: 'Does this need a axis label?'
	        }
	    },   
	    xAxis: {
	    						allowDecimals: false,

	    },
	    legend: {
	        layout: 'vertical',
	        align: 'center',
	        verticalAlign: 'bottom'
        
	    },

	    plotOptions: {
	        series: {
	            label: {
	                connectorAllowed: false
	            },
	             marker: {
	                enabled: false
	            },
	            pointStart: 2014,
	}
	    },
	   tooltip: {
	        formatter: function () {
	            return this.series.name +
	                '<br><b>' + this.y + '%</b>';
	        }
	    },
	 series: [{name:'Hovedstaden',data: [16.8,14.7,5.1,9.1,]},{name:'Midtjylland',data: [-26.9,-59.7,-33,8.8,]},{name:'Nordjylland',data: [7.4,26,36.7,32.9,]},{name:'Syddanmark',data: [-32.1,19.2,-20.3,-41.2,]},{name:'Gennemsnit',data: [9.9,12,3,7.2,],dashStyle: 'shortdot',color:"#C1272D"}],
  

	    responsive: {
	        rules: [{
	            condition: {
	                maxWidth: 500
	            },
	            chartOptions: {
	                legend: {
	                    layout: 'horizontal',
	                    align: 'center',
	                    verticalAlign: 'bottom'
	                }
	            }
	        }]
	    }

	});