1👍
Here is one solution where we check if the the window size is less than 600px and return 12 else the tick limit is 24
xAxes: [{
type: 'time',
ticks: {
autoSkip: true,
maxTicksLimit: getTickLimit()
}
}]
function getTickLimit(){
return window.innerWidth<600? 12:24
}
- Chartjs-Chartjs xAxes gridline html (html in ticks callback)
- Chartjs-Chart js show levels on top. (Bar chart with Stacked group)
Source:stackexchange.com