Create Google pie charts - Javascript Google Chart

Javascript examples for Google Chart:Pie Chart

Description

Create Google pie charts

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Pie Chart Example</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> 
      <div id="piechart" style="width: 900px; height: 500px;"></div> 
      <script type="text/javascript">
      google.charts.load('current', {'packages':['corechart']});
      google.charts.setOnLoadCallback(drawChart);
      function drawChart() {// w  w w. ja  v a  2s .c o m
var ss=[['Solution','TOTAL'],['Check',23],['FULL',18],['POP',109]];
        var data = google.visualization.arrayToDataTable(ss);
    var options = {
      title: 'My Daily Activities',
      pieHole: 0.4,
    };
        var chart = new google.visualization.PieChart(document.getElementById('piechart'));
        chart.draw(data, options);
      }

      </script>  
   </body>
</html>

Related Tutorials