You must be logged in to post your query.
Home › Forums › Chart Support › how do i achieve displaying graphs by weeks based on date?
// query para sa year of enrollment $res = $conn->query(“SELECT *, SUM(visitor_price) FROM visitors GROUP BY year”) or die(mysqli_error()); $data_points = array(); while($result = $res->fetch_array()){ $R = $result[‘year’]; $q1 = $conn->query(“SELECT *, SUM(visitor_price) as total FROM visitors WHERE year = ‘$R’ group by year”) or die(mysqli_error()); $f1 = $q1->fetch_array(); $FR = intval($f1[‘total’]);$R = $result[‘year’]; $point = array(‘label’ => $R, ‘y’ => $FR); array_push($data_points, $point); } json_encode($data_points);
visitors
year
this is my query by year and I would like to know by Weeks
@jfranco30,
CanvasJS just renders charts based on the data that you pass in the chart-options. You can modify your MySQL query to get data based on weeks and pass it to chart to show weekly data.
____ Shashi Ranjan Team CanvasJS
You must be logged in to reply to this topic. Login/Register