Home forums Using CanvasJS Display data from MySQL database in line chart Reply To: Display data from MySQL database in line chart

#23059

Priyanka M S
Member

@zaid1987,

CanvasJS accepts only numeric or dateTime x-values and numeric y-values.
In here, array_push($dataPoints, array("x"=> $row->Name, "y"=> $row->id));, you are assgning string values to x-values which CanvasJS do not accept. Assigning string values to label (array_push($dataPoints, array("label"=> $row->Name, "y"=> $row->id));) should work fine in your case.

If this doesn’t solve your issue, kindly create a sample project reproducing the issue you are facing and share it over Google-Drive or Onedrive along with the sample database so that we can look into your code, understand it better and help you out.

__
Priyanka M S
Team CanvasJS