offsetGridLines (category scale) v2.4
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.js"></script>
<canvas id="myChart1"></canvas>
<canvas id="myChart2"></canvas>
JavaScript
var ctx1 = document.getElementById('myChart1').getContext('2d');
var chart1 = new Chart(ctx1, {
type: 'bar',
data: {
labels: [0, 1, 2, 3],
datasets: [{
data: [0, 1, 2, 3]
}]
},
options: {
title: {
display: true,
text: 'offsetGridLines: true'
},
scales: {
xAxes: [{
//type: 'time',
gridLines: {
offsetGridLines: false
}
}]
}
}
});
var ctx2 = document.getElementById('myChart2').getContext('2d');
var chart2 = new Chart(ctx2, {
type: 'bar',
data: {
labels: [0, 1, 2, 3],
datasets: [{
data: [0, 1, 2, 3]
}]
},
options: {
title: {
display: true,
text: 'offsetGridLines: false'
},
scales: {
xAxes: [{
//type: 'time',
gridLines: {
offsetGridLines: false
}
}]
}
}
});