Home forums Using CanvasJS Date Format Reply To: Date Format

#20968

Priyanka M S
Member

@liyen,

Convert $row->x to PHP timestamp from string, later converting it to javascript timestamp and assigning that value to dataPoint x-value along with setting xValueType to ‘dateTime’ should work fine in your case. array_push($dataPoints, array(“x”=> strtotime($row->x) * 1000, “y”=> $row->y));

__
Priyanka M S
Team CanvasJS