Chartjs-Chart.js showing nothing on canvas

0๐Ÿ‘

โœ…

I solved my error editing the first script from this:

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.js" />

to this:

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.js" ></script>

as suggested by @j.ian.le

And adding

responsive: false,

under options: {

0๐Ÿ‘

You should remove the ... under backgroundColor and borderColor or add colors according to the number of labels.

0๐Ÿ‘

You need to call myChart.update() after initializing the chart.

Leave a comment