Chapter 3: Population Graph 65 and Over (2)
X axis year number using pointStart in series option. Problem: the point value is formatted with the numberFormat function
HTML
<script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script>
<body>
<div style="margin: 5px 60px 5px 5px; " id='container'></div>
</body>
JavaScript
$(document).ready(function() {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
},
title: {
text: 'Population ages 65 and over (% of total)',
},
credits: {
position: {
align: 'left',
x: 20
},
text: 'Data from The World Bank'
},
xAxis: {
},
yAxis: {
title: {
text: 'Percentage %',
}
},
series: [{
pointStart: 1980,
name: 'Japan - 65 and over',
data: [15, 8, 8, 10, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14,
15, 15, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 23]}]
});
});