Chartjs-Chartjs โ€“ canvas size error

2๐Ÿ‘

โœ…

You need to add responsive: false to you chart configuration

var myChart = new Chart(ctx, {
    type: 'line',
    data: {
        ...
    },
    options: {
        responsive: false,
        scales: {
            ...
        }
    }
});

Otherwise, the chart tries to be as large as its container

Leave a comment