Я хочу настроить столбец диаграммы js Ось Y с разницей в два.
В настоящее время значения оси Y равны 0, 10, 20, 30 Но мне нужно как 0,2 , 4,6,8 ... 30. Мой код ниже
<script>
$( document ).ready(function() {
var BarsChart = (function() {
var $chart = $('#chart-bars');
function initChart($chart) {
var ordersChart = new Chart($chart, {
type: 'bar',
data: {
labels: ["Jan","Feb","Mar","Apr","May"],
datasets: [{
label: 'Events',
data: [0,5,6,0,0],
backgroundColor: "#2dce89"
}]
},
options: {
scales: {
yAxes: [{
display: true,
ticks: {
beginAtZero: true,
stepSize: 2,
max: 30
}
}]
}
}
});
$chart.data('chart', ordersChart);
}
if ($chart.length) {
initChart($chart);
}
})();
});
</script>