master
by andig2
HTML
<script src="http://www.chartjs.org/dist/master/Chart.bundle.js"></script>
<canvas id="canvas" width="400" height="200"></canvas>
JavaScript
Chart.defaults.global.defaultFontSize = 16;
var ctx = document.getElementById("canvas");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: [
'2008-12-31', '2009-12-31', '2010-12-31', '2011-12-31', '2012-12-31',
'2013-12-31', '2014-12-31', '2015-12-31', '2016-12-31', '2017-05-23'
],
datasets: [{
label: 'data',
data: [
200, 400, 800, 1600, 3200,
6400, 12800, 25600, 51200, 102400
]
}]
},
options: {
scales: {
xAxes: [{
type: 'time',
time: {
unit: 'year',
round: 'year'
}
}]
}
}
});