[Chartjs]-Chartjs โ€“ custom y axis range

4๐Ÿ‘

I am able to fix this issue by following configurations.

yAxes: [{
        scaleLabel: {
            display: true,
            labelString: 'LABEL',
        },
        type: 'logarithmic',
        position: 'left',
        ticks: {
             min: 0, //minimum tick
             max: 10000000, //maximum tick
             callback: function (value, index, values) {
                 return Number(value.toString());//pass tick values as a string into Number function
             }
        },
        afterBuildTicks: function (chartObj) { //Build ticks labelling as per your need
            chartObj.ticks = [0,10,100,1000,10000,100000,1000000,10000000];
        }
    }]

Leave a comment