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.
[
{
“report_date”:”2016-02-02″,
“submited”:1,
“approved”:”1″,
“declined”:”0″
},
{
“report_date”:”2016-02-03″,
“submited”:2,
“approved”:”0″,
“declined”:”1″
},
{
“report_date”:”2016-02-17″,
“submited”:1,
“approved”:”0″,
“declined”:”0″
}
]
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);
//AJAX
success: function(data){
var result = $.parseJSON(data);
var columnchart = new CanvasJS.Chart(“chartContainer”, {
title:{
text: “Overall report statistic”
},
axisX:{
gridColor: “Silver”,
tickColor: “silver”,
valueFormatString: “DD/MMM”
},
data: result
});
columnchart.render();
}
Really Appreciated for your help.
Best Regards,
Elvis Ximenes