Bar charts flickering issue in charts js

๐Ÿ‘:0

add this on your code to disable zooming Y direction

zoom: {
            // Boolean to enable zooming
            enabled: false,                     
            // Zooming directions. Remove the appropriate direction to disable 
            // Eg. 'y' would only allow zooming in the y direction
            mode: 'y',
        }

exaple:

    var myChart = new Chart(ctx, {
    type: 'bar',
    data: {
        labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
        datasets: [{
            label: '# of Votes',
            data: [12, 19, 3, 5, 2, 3]
        }]
    },
    options: {
        scales: {
            yAxes: [{
                ticks: {
                    beginAtZero:true
                }
            }]
        },
        pan: {
            enabled: true,

            mode: 'x',

            speed: 1
        },

        zoom: {
            enabled: false,                     
            mode: 'y',
        }
    }
});

Next time please provide your code

Leave a comment