[Chartjs]-Why is ChartJS skipping an xAxis label in this snippet?

3👍

What you are actually looking for can be done with the userCallback property in the options :

options: {
    scales: {
        xAxes: [{
            ticks: {
                userCallback: function(value, index) {
                    if (index % 2) return "";
                    return value;
                }
            }
        }]
    }
}

See the documentation about it (scroll up a bit) for more information.

You can check this updated plunker, and its result :

enter image description here

Leave a comment