<?php
$db->setQuery("SELECT MartabehName, COUNT(MartabehCode) FROM `#__dimteacher` GROUP BY MartabehName");
$countMartabehName = $db->loadObjectList();
foreach($countMartabehName as $row) {
foreach($row as $key => $data) {
echo $data."<br />";
}
}
foreach($countMartabehName as $row) {
$dataPoints = array(
array("label"=> $row->MartabehName , "y"=> $row->$key)
);
}
?>
<script>
my chart code from https://canvasjs.com/
.
.
,
.
.
</script>
<script src="https://canvasjs.com/assets/script/canvasjs.min.js">
</script>
How can I show all array (datax1,.... datax4) in chart?
It is only displaying the last array member in chart (datax4).