Projection Chart
by JoeKuan
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function () {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
title: {
text: 'UK Life Expectancy',
x: -20 //center
},
subtitle: {
text: 'Source: National Statistics',
x: -20
},
xAxis: {
allowDecimals: false,
labels: {
formatter: function() {
return this.value;
}
}
},
yAxis: {
title: {
text: 'Age'
},
min: 70
},
plotOptions: {
series: {
pointStart: 2005
}
},
series: [{
name: 'Current',
color: '#4572A7',
data: [ 76.9, 77.2, 77.4, 77.6, 78.1, 78.5, 78.6 ]
}, {
name: 'Future',
dashStyle: 'dot',
color: '#4572A7',
data: [ [ 2011, 78.6 ], [ 2012, 78.9 ], [ 2013, 79.2 ], [ 2014, 79.4 ], [ 2015, 79.7 ] ]
}]
});
});
});