Highcharts Demo
author(s): Torstein Hønsi
by abbylangner
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/series-label.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', {
title: {
text: 'Solar Employment Growth by Sector, 2010-2016'
},
subtitle: {
text: 'Source: thesolarfoundation.com'
},
yAxis: {
title: {
text: 'Number of Employees'
},
labels: {
formatter: function(){
return '$'+this.axis.defaultLabelFormatter.call(this);
}
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle'
},
plotOptions: {
series: {
label: {
connectorAllowed: false
},
pointStart: 2010
}
},
series: [{
name: 'Installation',
data: [43934, 52503, 571.77, 696.58, 970.31, 119931, 137.133, 154.175]
}, {
name: 'Manufacturing',
data: [249.16, 240.64, 297.42, 298.51, 324.90, 302.82, 381.21, 404.34]
}, {
name: 'Sales & Distribution',
data: [117.44, 177.22, 160.05, 197.71, 201.85, 243.77, 321.47, 393.87]
}, {
name: 'Project Development',
data: [null, null, 798.8, 121.69, 151.12, 224.52, 344.00, 342.27]
}, {
name: 'Other',
data: [129.08, 594.8, 810.5, 112.48, 898.9, 118.16, 182.74, 181.11]
}],
responsive: {
rules: [{
condition: {
maxWidth: 500
},
chartOptions: {
legend: {
layout: 'horizontal',
align: 'center',
verticalAlign: 'bottom'
}
}
}]
}
});