Chartjs-Dynamic Chart in PHP using Chart js

0👍

your "graphDiv" html element needs to be a canvas. not a div.

<canvas id="myChart" width="100%" height="50%"></canvas>

You also have the wrong id on your ctx variable.

let ctx = document.getElementById('myChart').getContext('2d'); // canvas

Leave a comment