Chartjs-Put JSON data into chart.js pie chart

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);
       }
    });

Leave a comment