You must be logged in to post your query.
Home › Forums › Chart Support › Help with Spline Chart
I understand about using the chart with php my only question is how to convert the Date to Timestamp in the format you use?
@lonster_monster,
To convert PHP date to JavaScript timestamp, first you need to convert PHP date to PHP timestamp using strtotime and then convert PHP timestamp to JavaScript timestamp by multiplying PHP timestamp by 1000.
$phpDate = date("Y-m-d h:i:sa"); $phpTimestamp = strtotime($phpDate); $javaScriptTimestamp = $phpTimestamp * 1000;
— Vishwas R Team CanvasJS
Would i do it like this in my php array_push($dataPoints, array("x"=> $row->strtotime(Date)*1000, "y"=> $row->Profits));
array_push($dataPoints, array("x"=> $row->strtotime(Date)*1000, "y"=> $row->Profits));
I got it thanks i use array_push($dataPoints, array(“x”=> $PHPstr=strtotime($row->Date)*1000, “y”=> $row->Profits));
Glad that it works :)
You must be logged in to reply to this topic. Login/Register