[Chartjs]-Why can't I update the aspectRatio within the chartjs chart?

3👍

There is an issue in Chart.js about changes on chart.options.aspectRatio not taken into account. As a workaround, you can edit chart.aspectRatio directly and then call chart.resize().

function setAspectRatio() {
    myChart.aspectRatio = 9;
    myChart.resize();
}

Leave a comment