I can get the data from my query, but i dont know why it only print or display the last data
<script>
async function myFunction() {
var name = ("SELECT name FROM Person", 10, (value) => {
return value.forEach(reportChart)
});
}
myFunction().then(function(value){reportChart(value);})
function reportChart (value) {
console.log(value) //please see the result below
$("#chart").kendoChart({
title: {
text: "Library"
},
legend: {
visible: false
},
seriesDefaults: {
type: "bar"
},
series: [{
name: "Total Visits",
data: [value]
}, {
name: "Total Visits",
data: [value]
}],
valueAxis: {
max: 10,
line: {
visible: false
},
minorGridLines: {
visible: true
},
labels: {
rotation: "auto"
}
},
categoryAxis: {
categories: [value],
majorGridLines: {
visible: false
}
},
tooltip: {
visible: true,
template: "#= series.name #: #= value #"
}
});
}
$(document).ready(reportChart);
$(document).bind("kendo:skinChange", reportChart);
</script>
the result of console.log(value)
[‘Mark’]
[‘Joseph’]
[‘Luna’]
[‘Yuno’]
it only print the name yuno
please dont read this line, please dont read this line, please dont
read this line, please dont read this line, please dont read this
line, please dont read this line, please dont read this line, please
dont read this line, please dont read this line, please dont read this
line, please dont read this line, please dont read this line, please
dont read this line, please dont read this line, please dont read this
line, please dont read this line, please dont read this line, please
dont read this line,