Chartjs-Different major tick format in Chart.js

1👍

ticks: {
    major: {
        fontSize: 14,
        fontStyle: "bold"
    },
    callback: function(value, index, values) {
        if(values[index] !== undefined)
        {
            if(values[index].major==true)
            {
                return moment(values[index].value).format('DD/MM');
            }
            else
            {
                return value;
            }
        }
    }
}

Leave a comment