Choosing a Javascript charting library
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
$(function () {
$('#container').highcharts({
chart: {
type: 'column',
style : {
fontFamily : '"Arial", "Helvetica"',
fontSize : "14px"
}
},
colors : ['#F48024','#313131','#FFCC00'],
title: {
text: 'Choosing a Javascript charting library in 2016'
},
subtitle : {
text : 'Constrasting JS libraries based on Github stars, watches and Stackoverflow tagged questions'
},
xAxis: {
categories: ['Chart JS', 'Highcharts', 'Chartist JS', 'Flot', 'Google Charts']
},
yAxis: {
min: 0,
title: {
text: ''
},
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
}
}
},
legend: {
verticalAlign: 'bottom'
},
tooltip: {
headerFormat: '<b>{point.x}</b><br/>',
pointFormat: '{series.name}: {point.y}<br/>Total: {point.stackTotal}'
},
plotOptions: {
column: {
stacking: 'normal',
dataLabels: {
enabled: true,
color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white',
style: {
textShadow: '0 0 3px black'
}
}
}
},
series: [{
name: 'Stackoverflow tags',
data: [1762, 24162, 79, 1932, 5508]
}, {
name: 'Github watchers',
data: [5214, 325, 328, 336, 0]
}, {
name: 'Github stars',
data: [25145, 5467, 8573, 5126, 0]
}]
});
});