Simple horizontal bar chart
by Nayana Das
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
$(function () {
$('#container').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Normal Horizontal bar chart'
},
subtitle: {
text: ''
},
xAxis: {
categories: ['US', 'APAC', 'EU', 'Africa', 'EMEA', 'LATAM'],
title: {
text: null
}
},
yAxis: {
min: 0,
title: {
text: 'Category',
align: 'high'
},
labels: {
overflow: 'justify'
}
},
tooltip: {
valueSuffix: ' millions'
},
plotOptions: {
bar: {
dataLabels: {
enabled: true
}
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -40,
y: 80,
floating: true,
borderWidth: 1,
backgroundColor: ((Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'),
shadow: true
},
credits: {
enabled: false
},
series: [{
name: 'Technology',
data: [2309.65, 3709.395, 5175.171, 2892.51, 2832.96, 2862.675]
}, {
name: 'Furniture',
data: [1822.08, 5244.84, 5083.96, 4297.644, 4164.05, 4626.15]
}, {
name: 'Office Supplies',
data: [2616.96, 2221.8, 3701.52, 1869.588, 2249.91, 7958.58]
}]
});
});