0👍
To achieve this I had to skip the labels I didn’t want to show, but they had to be on the graph, even though not visible. Here is the code for the Y axis:
options: {
scales: {
yAxes: [{
scaleLabel: {
display: true,
labelString: 'Users'
},
gridLines: {
drawTicks: false
},
ticks: {
min: 400,
max: 1100,
stepSize: 50,
skipRatio: 2,
callback: function(tick, index, array){
return (index % 2) ? "" : tick;
},
padding: 5
}
}]
}
}
I did the same for the X axis and managed to get an identical graph to the one on the image.
- Chartjs-.destroy() generating error 'window.myChart.destroy()' is not a function
- Chartjs-Is there an option in chart.js to hide values in the graph legend
Source:stackexchange.com