0👍
showXLabels
is not documented. Where did you find this option?
You create your chart with a Category X-axis. As such, Chart.js simply renders the labels and data provided. The only way to limit to 5 would be to reduce your labels
array to 5 elements.
A Linear axis has a maxTicksLimit
property, but that’s not applicable here.
Source:stackexchange.com