Web Programming examples

Google Maps,AngularJS

Google Chart by AngularJS

  • AngularJS : 1.6.5
  • Bootstrap : 3.x
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <div ng-controller="MyCtrl" id="chart_div"></div>
    <script type='text/javascript' src='js/angular.min.js'></script>
    <script type="text/javascript" src="js/app.js"></script>
google.charts.load('current', {packages: ['corechart']});

google.charts.setOnLoadCallback(function() {
  angular.bootstrap(document.body, ['googleMapApp']);

angular.module('myApp', []).
  controller('MyCtrl', ['$scope',
    function($scope) {
      var data = new google.visualization.DataTable();
      data.addColumn('string', 'Topping');
      data.addColumn('number', 'Slices');
        ['Mushrooms', 3],
        ['Onions', 1],
        ['Olives', 1],
        ['Zucchini', 1],
        ['Pepperoni', 2]
      var options = {'title':'How Much Pizza I Ate Last Night',
      var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
      chart.draw(data, options);

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.