Fixed by using this https://ljvmiranda921.github.io/notebook/2017/02/21/make-canvasjs-chart-from-mysql-data/