2๐
โ
$.ajax({
url: 'chartpi.php',
success: function (response) {//response is value returned from php
alert(response); //showing response is working
var datachart = JSON.parse(response);
var ctx2 = document.getElementById("chart-area2").getContext("2d");
window.myPie = new Chart(ctx2).Pie(datachart);
}
});
Source:stackexchange.com