can any one assist where i made mistake!!!
fetch(‘data.php’,{
method:”post”,
body:formData
}).then(response=>response.json()).then(result=>{
let dataPoints = [];
const chart = new CanvasJS.Chart(“chartContainer”,
animationEnabled:true,
theme:”light2″,
title:{
text:”Attendance Chart”
},
axisY:{
title:”numbers”,
titleFontSize:”24″
},
data:[{
type:”column”,
yValueFormatString:”#,###,## numbers”,
dataPoints:dataPoints
}]
})
function (result){
for(let i=0;i<result.data;i++){
dataPoints.push({
x: result[i].districts
y: result[i].students
})
}
}
}).catch(error=>{
$(“#fetcherror”).text(error)
});