Home forums Using CanvasJS How can I use PHP MySQL Dynamic data Reply To: How can I use PHP MySQL Dynamic data



Hi Sunil,
Refering to the thread #3669 , i am only get one line for line chart.
based on my JSON data from MySQL below: how can i display into in multi series line charts.
– The report_date will be in x axis
– submited,approved,declined will be displayed in three different lines.


When i do below, i only get one line.
$result= getReportStatistic($startDate,$endDate);
$data_points = array();
foreach($result as $row){
$point = array(“label”=>$row[‘report_date’],”y”=>$row[‘submited’]);
array_push($data_points, $point);
echo json_encode($data$data_points, JSON_NUMERIC_CHECK);

success: function(data){
var result = $.parseJSON(data);
var columnchart = new CanvasJS.Chart(“chartContainer”, {
text: “Overall report statistic”
gridColor: “Silver”,
tickColor: “silver”,
valueFormatString: “DD/MMM”
data: result

Really Appreciated for your help.
Best Regards,
Elvis Ximenes