1👍
This is your problem
foreach($vak as $vak)
$vak = $vak->getCode();
You are destroying your $vak
array in these commands.
Do not reuse the $vak
variable all over the place. Try this instead.
$vaks = $q->getVakAll();
$data = array();
foreach($vaks as $vak){
$code = $vak->getCode();
$result = $q->getAanwezigheidVakkenPerJaar($value, $code);
foreach ($result as $row) {
$data[] = $row;
}
}
0👍
instead of print
use : echo json__encode(array) die;
hope this help.
- Chartjs-Chartjs 2 Line Graph Single Stroke Between Datasets
- Chartjs-Chart.js number of labels equal to number of datapoints
Source:stackexchange.com