1👍
✅
Media query would be a good idea if it’s working, but I don’t know that.
I have a solution with chart.js
but I don’t know if that’s what you want. Right now I remove the ticks completely (including grid lines) if the chart area is small enough. If you just want to hide the ticks you need to adapt the code a little bit like I do in the lines which I commented.
Complete code: https://jsbin.com/lifubiriye/edit?js,output
Important part:
function setChartWidth() {
chartWidth = document.getElementById("chart").width
if (chartWidth < 756) {
myChart.options.scales.xAxes[0].display = false
} else {
myChart.options.scales.xAxes[0].display = true
}
}
Source:stackexchange.com