Chart.js #6300 test02
by Akihiko Kusanagi
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/nagix/nagix.github.io@chartjs/Chart.6300.js"></script>
<div>
<canvas id="chart" width=450 height=200></canvas>
</div>
JavaScript
new Chart(document.getElementById("chart"), {
type: 'line',
data: {
labels: ['2015-01-01T00:00', '2015-02-01T00:00', '2015-03-01T00:00', '2015-04-01T00:00', '2015-05-01T00:00', '2015-06-01T00:00']
},
options: {
//responsive: false,
legend: {
display: false
},
scales: {
xAxes: [{
type: 'time',
ticks: {
maxRotation: 0
},
time: {
unit: 'month',
displayFormats: {
month: 'MMMM YYYY'
}
}
}, {
type: 'time',
position: 'top',
ticks: {
minRotation: 1,
},
time: {
unit: 'month',
displayFormats: {
month: 'MMMM YYYY'
}
}
}],
yAxes: [{
display: false,
}, ],
}
}
});