Hi Priyanka,
Thanks for your sharing, I’m able to get it display properly now :)
May I know how to put the new Date() into the array?
array_push($dataPoints, array(“x”=> $row->x, “y”=> $row->y));
I tried the below, it is not working:
array_push($dataPoints, array(“x”=> “new Date(\””.$row->x.”\”)”, “y”=> $row->y));
Thanks.
Thanks for your reply :)
I have uploaded a simplified html file here: https://goo.gl/s5ZdfT
There’s no data for July from the database, but I wish to show it on the chart…
I extracted the data from database using this tutorial: https://canvasjs.com/php-charts/chart-data-from-database/
The data looks like below:
dataPoints: [ { x: 2018-05, y: 71 }, { x: 2018-06, y: 55 }, { x: 2018-07, y: 50 }, { x: 2018-09, y: 65 }, ]
Any way to show no data for 2018-08?
p/s: I’m not sure how to put it on jsfiddle
Thanks for your sharing Priyanka :)