Highcharts data label
by Kieran Dang
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: 300px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Theo thiết bị kích hoạt (%)'
},
subtitle: {
text: 'Source: Flurry Analytics'
},
xAxis: {
type: 'category',
labels: {
rotation: -45,
}
},
yAxis: {
min: 0,
title: {
text: ''
}
},
legend: {
enabled: false
},
tooltip: {
pointFormat: '<b>{point.y:.1f} %</b>'
},
series: [{
name: '%',
data: [
['Columbia', 278],
['Vietnam', 266],
['Turkey', 247],
['Ukraine', 237],
['Egypt', 211],
['China', 209],
['Chile', 209],
['India', 189],
['Venezuela', 182],
['S.Africa', 177],
['Thailand', 176],
['Philippines', 171],
],
dataLabels: {
enabled: true,
rotation: -90,
align: 'right',
format: '{point.y:.0f} %', // one decimal
y: 10, // 10 pixels down from the top
style: {
fontSize: '11px',
fontFamily: 'Verdana, sans-serif'
}
}
}]
});
});