I am new at this. My pie chart only shows the data in the y axis
js file:
`
$(document).ready(function(){
var dataPoints = [];
var pieGraph = new CanvasJS.Chart(“pieGraph”,{
animationEnabled: true,
title:{
text:”Pie Graph”
},
data: [{
type: “pie”,
dataPoints : dataPoints,
}]
});
function addData(data) {
dataPoints.push({
x: data.Male,
y: parseInt(data.Female) //it only shows this
});
pieGraph.render();
}
$.getJSON(“localhost:8080/genderRatio”, addData);
});
`
Here is my json:
`
{
“Male”: 5,
“Female”: 4
}
`