Chartjs-ChartJS Chart not Resizing

0👍

In your css style, need to change width and height to max-width and max-height.

I tried this code myself and it was OK.

#chart {
        background: black;
        padding: 20px;
        border-radius: 30px;
        margin-bottom: 50px;
        max-width:  1000px;//change here to resize
        max-height: 500px;
    }

And I use following js code

<script src='https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js'></script>

democode

Leave a comment