Advertisement
ccalvert

Chart

Feb 4th, 2015
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // main.js
  2.  
  3. console.log('bootstrap setup');
  4.  
  5. $scope.singleModel = 0;
  6.  
  7. $scope.radioModel = 'Middle';
  8.  
  9. $scope.checkModel = {
  10.    left: false,
  11.    middle: true,
  12.    right: false
  13. };
  14.  
  15.  
  16. /** app.js */
  17.  
  18. 'use strict';
  19.  
  20. angular
  21.     .module('sourceApp', [
  22.     'googlechart',
  23.         'ui.bootstrap',
  24.         'ngAnimate',
  25.         'ngCookies',
  26.         'ngResource',
  27.         'ngRoute',
  28.         'ngSanitize',
  29.         'ngTouch'
  30.     ])
  31.     .config(function ($routeProvider) {
  32.         $routeProvider
  33.             .when('/', {
  34.                 templateUrl: 'views/main.html',
  35.                 controller: 'MainCtrl'
  36.             })
  37.             .when('/about', {
  38.                 templateUrl: 'views/about.html',
  39.                 controller: 'AboutCtrl'
  40.             })
  41.             .otherwise({
  42.                 redirectTo: '/'
  43.             });
  44.     });
  45.  
  46.  
  47. /** Chart **/
  48.  
  49.         $scope.chartObject = {};
  50.  
  51.  
  52.         $scope.onions = [
  53.             {v: "Onions"},
  54.             {v: 3}
  55.         ];
  56.  
  57.         $scope.chartObject.data = {"cols": [
  58.             {id: "t", label: "Topping", type: "string"},
  59.             {id: "s", label: "Slices", type: "number"}
  60.         ], "rows": [
  61.             {c: [
  62.                 {v: "Mushrooms"},
  63.                 {v: 3}
  64.             ]},
  65.             {c: $scope.onions},
  66.             {c: [
  67.                 {v: "Olives"},
  68.                 {v: 31}
  69.             ]},
  70.             {c: [
  71.                 {v: "Zucchini"},
  72.                 {v: 1}
  73.             ]},
  74.             {c: [
  75.                 {v: "Pepperoni"},
  76.                 {v: 2}
  77.             ]}
  78.         ]};
  79.  
  80.  
  81.         // $routeParams.chartType == BarChart or PieChart or ColumnChart...
  82.         $scope.chartObject.type = 'PieChart';// $routeParams.chartType;
  83.         $scope.chartObject.options = {
  84.             'title': 'How Much Pizza I Ate Last Night'
  85.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement