Json to google visualisation

20 views
Skip to first unread message

evans ryanada

unread,
Oct 6, 2017, 4:35:56 AM10/6/17
to Google Visualization API
i have the following code
{ codgoogle.charts.load('current', {'packages':['corechart']});
    google.charts.setOnLoadCallback(drawChart);
         function drawChart() {
          var jsonData = $.ajax({
          url: "test.json",
          dataType: "json",
          async: false
          }).responseText;
      var data = new google.visualization.DataTable(jsonData);
      var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
      chart.draw(data, {width: 400, height: 240});
    }
Enter code here...[{"id":2365,"Name":"hyena"},{"id":3256,"Name":"lioness"},{"id":25,"Name":"rabbit"},{"id":123,"Name":"porcupine"}]

so am trying to figure out how to create piechart since on the html side am getting table has columns



Reply all
Reply to author
Forward
0 new messages